Skip to content

Commit

Permalink
NPE fix + update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Jan 7, 2024
1 parent 820805d commit e3e2d44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 1.4.22
* Added: Support for resolving & completion for typeParameters with anonymous structures.
* Added: Check argument types in call expressions for functionTypes from typeParameters.
* Improvement: better handling of import statements with aliases.
* Misc NPE fixes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ public void specializeByParameters(@Nullable List<PsiElement> typeList) {
final PsiElement specializedType = typeList.get(i);

if (genericParamName == null) continue;
if (specializedType == null) continue;

final HaxeResolveResult specializedTypeResult = HaxeResolveUtil.getHaxeClassResolveResult(specializedType, specialization);
if(specializedTypeResult.getHaxeClass() != null) {
Expand All @@ -479,10 +480,10 @@ public void specializeByParameters(@Nullable List<PsiElement> typeList) {
else if(specializedTypeResult.getFunctionType() != null) {
specialization.put(haxeClass, genericParamName, specializedTypeResult);
}else {
//TODO: Experimental (adding fake haxeClass for generic types that are not connected to nay type yet)
HaxeClassWrapperForTypeParameter aClass = new HaxeClassWrapperForTypeParameter(specializedType.getNode(), List.of());
HaxeResolveResult result = HaxeResolveResult.create(aClass, new HaxeGenericSpecialization());
specialization.put(haxeClass, genericParamName, result);
//TODO: Experimental (adding fake haxeClass for generic types that are not connected to any type yet)
HaxeClassWrapperForTypeParameter aClass = new HaxeClassWrapperForTypeParameter(specializedType.getNode(), List.of());
HaxeResolveResult result = HaxeResolveResult.create(aClass, new HaxeGenericSpecialization());
specialization.put(haxeClass, genericParamName, result);
}

}
Expand Down

0 comments on commit e3e2d44

Please sign in to comment.