Skip to content

Commit

Permalink
bugfix + 1.4.41 release
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rkeulv committed Feb 20, 2024
1 parent 77c136b commit 237401c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Changelog
## 1.4.41
* Bugfix: fixed type resolve regression for iterators
## 1.4.40
* Fixed: incomplete member list for anonymous strcutures
* Fixed: wrongfully marking wildcard import statement as unused
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginName = Haxe Toolkit Support
pluginRepositoryUrl = https://github.com/HaxeFoundation/intellij-haxe

# SemVer format -> https://semver.org
pluginVersion = 1.4.40
pluginVersion = 1.4.41

# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
platformType = IU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ private static HaxeResolveResult getHaxeClassResolveResultInternal(@Nullable Psi
return HaxeResolveResult.EMPTY;
}
final HaxeExpression expression = iterable.getExpression();
if (expression instanceof HaxeReference) {
if (expression instanceof HaxeReference reference) {

final HaxeResolveResult resolveResult = ((HaxeReference)expression).resolveHaxeClass();
final HaxeResolveResult resolveResult = reference.resolveHaxeClass();
List<String> circularReferenceProtection = new LinkedList<>();
return searchForIterableTypeRecursively(resolveResult,circularReferenceProtection);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,4 +876,9 @@ public void testTypeTagsShouldNotResolveToEnumValue2() throws Throwable {
myFixture.enableInspections(HaxeUnresolvedSymbolInspection.class);
doTestNoFixWithWarnings("test/EnumWithClassNameValues.hx");
}
@Test
public void testIteratorTypeResolve() throws Throwable {
myFixture.enableInspections(HaxeUnresolvedSymbolInspection.class);
doTestNoFixWithWarnings();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package;

import haxe.ds.IntMap;

class Test {

public static function main() {

// iterate map
var map = [ 1 => "one", 2 => "two" ];
var intmap:IntMap<String> = [ 1 => "one", 2 => "two" ];
var mapi:Map<Int, String> = [ 1 => "one", 2 => "two" ];

for (key => value in map) {
value.length * key;
}
for (key => value in intmap) {
value.length * key;
}
for (key => value in mapi) {
value.length * key;
}

// iterate Array
var arr1:Array<String>;
var arr2 = new Array<String>();

arr1.iterator();

for (value in arr1) {
value.length;
}
for (value in arr2) {
value.length;
}

for (key => value in arr1) {
//TODO mlo: fix test standard lib so this works (added after 4.0.5)
value.<warning descr="Unresolved symbol">length</warning> * key;
}
for (key => value in arr2) {
//TODO mlo: fix test standard lib so this works (added after 4.0.5)
value.<warning descr="Unresolved symbol">length</warning> * key;
}
// iterate string
var str:String;
for (value in str) {
//TODO mlo: fix test standard lib so this works
value.<warning descr="Unresolved symbol">length</warning>;
}

for (key => value in str) {
value.length * key;
}

}
}

0 comments on commit 237401c

Please sign in to comment.