-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cs] Consider String as basic type (#8387)
* Add failing tests * [cs] Consider String as basic type too * HxObject.getParams() returns an Array<{}> * Add tests for #5434
- Loading branch information
Showing
6 changed files
with
34 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
interface ITest<K, V> { | ||
function keys():Array<K>; | ||
function values():Array<V>; | ||
} | ||
|
||
interface ISubTest extends ITest<String, String> {} |
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,2 @@ | ||
Main | ||
-cs bin |
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,22 @@ | ||
class SortedStringMapImpl<V> extends haxe.ds.BalancedTree<String, V> implements haxe.Constraints.IMap<String,V> { | ||
|
||
var cmp:String -> String -> Int; | ||
|
||
public function new(?comparator:String -> String -> Int) { | ||
super(); | ||
this.cmp = comparator == null ? haxe.Utf8.compare : comparator; | ||
} | ||
|
||
override | ||
function compare(s1:String, s2:String):Int { | ||
return cmp(s1, s2); | ||
} | ||
} | ||
|
||
class Main { | ||
static function main() { | ||
var m = new SortedStringMapImpl<String>(); | ||
m.set("foo", "bar"); | ||
trace(m); | ||
} | ||
} |
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,2 @@ | ||
-main Main | ||
-cs bin |