-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accept monomorphs as type parameters for safe casts (closes #4675)
- Loading branch information
Showing
2 changed files
with
21 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package unit.issues; | ||
|
||
class Issue4675 extends Test { | ||
function test() { | ||
var m: Map<String, Dynamic> = new Map(); | ||
m.set("a", 1); | ||
eq(1, someFunction(m)); | ||
} | ||
|
||
public static function someFunction(arg: Dynamic) { | ||
var map: Map<String, Dynamic> = cast(arg, Map<String, Dynamic>); | ||
return map["a"]; | ||
} | ||
} |
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