forked from HaxeFoundation/haxe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[matcher] look through enum abstracts to find actual match kind
closes HaxeFoundation#11213
- Loading branch information
Showing
8 changed files
with
98 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
enum Ordering { | ||
EQ; | ||
LT; | ||
GT; | ||
} | ||
|
||
@:publicFields | ||
enum abstract TriState(Ordering) from Ordering { | ||
var True = GT; | ||
var False = LT; | ||
var Both = EQ; | ||
|
||
function icon():Int { | ||
return switch (this : TriState) { | ||
case True:1; | ||
case Both:3; | ||
} | ||
} | ||
} | ||
|
||
function main() {} |
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 @@ | ||
enum Ordering { | ||
EQ; | ||
LT; | ||
GT; | ||
} | ||
|
||
@:publicFields | ||
enum abstract TriState(Ordering) from Ordering { | ||
var True = GT; | ||
var False = LT; | ||
var EvenFalser = LT; | ||
var Both = EQ; | ||
|
||
function icon():Int { | ||
return switch (this : TriState) { | ||
case True:1; | ||
case Both:3; | ||
} | ||
} | ||
} | ||
|
||
function main() {} |
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 @@ | ||
Main |
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 @@ | ||
Main.hx:14: characters 17-34 : Unmatched patterns: False |
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 @@ | ||
Main2 |
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 @@ | ||
Main2.hx:15: characters 17-34 : Unmatched patterns: False |
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,30 @@ | ||
package unit.issues; | ||
|
||
import utest.Assert; | ||
|
||
private enum Ordering { | ||
EQ; | ||
LT; | ||
GT; | ||
} | ||
|
||
@:publicFields | ||
private enum abstract TriState(Ordering) from Ordering { | ||
var True = GT; | ||
var False = LT; | ||
var Both = EQ; | ||
|
||
function icon():Int { | ||
return switch (this : TriState) { | ||
case True: 1; | ||
case False: 2; | ||
case Both: 3; | ||
} | ||
} | ||
} | ||
|
||
class Issue11213 extends unit.Test { | ||
function test() { | ||
Assert.pass(); | ||
} | ||
} |