-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/test/resources/testData/annotation.semantic/IteratorTypeResolve.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} | ||
} |