-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
3 changed files
with
62 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package unit.issues; | ||
using Issue9749.Issue9749_XTools; | ||
|
||
class Issue9749 extends Test { | ||
function test() { | ||
var x = {x: 0}; | ||
var y: TypeY = x; | ||
var a: TypeA = x; | ||
var b: TypeB = x; | ||
var c: TypeC = x; | ||
var d: TypeD = x; | ||
eq('X', x.tool()); | ||
eq('X', y.tool()); | ||
eq('A', a.tool()); | ||
eq('B', b.tool()); | ||
eq('C', c.tool()); | ||
eq('C', d.tool()); | ||
} | ||
} | ||
|
||
private typedef TypeY = {x: Int}; | ||
|
||
@:using(Issue9749.Issue9749_TypeATools) private typedef TypeA = {x: Int}; | ||
|
||
@:using(Issue9749.Issue9749_TypeBTools) private typedef TypeB = {x: Int}; | ||
|
||
@:using(Issue9749.Issue9749_TypeCTools) private typedef TypeC = TypeB; | ||
|
||
private typedef TypeD = TypeC; | ||
|
||
class Issue9749_XTools { | ||
public static function tool(x: {x: Int}) return 'X'; | ||
} | ||
|
||
class Issue9749_TypeATools { | ||
public static function tool(a: {x: Int}) return 'A'; | ||
} | ||
|
||
class Issue9749_TypeBTools { | ||
public static function tool(b: {x: Int}) return 'B'; | ||
} | ||
|
||
class Issue9749_TypeCTools { | ||
public static function tool(c: {x: Int}) return 'C'; | ||
} |