Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow parsing postfix ! but fail during typing (closes #4284)
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 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,19 @@ | ||
package unit.issues; | ||
|
||
private abstract A(String) { | ||
public inline function new(s) this = s; | ||
|
||
@:op(A!) function opNot() { | ||
return this.toUpperCase(); | ||
} | ||
} | ||
|
||
class Issue4284 extends Test { | ||
function test() { | ||
var a = new A("foo"); | ||
eq("FOO", a!); | ||
|
||
var b = true; | ||
t(unit.TestType.typeError(b!)); | ||
} | ||
} |
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
2a5c5cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Can't wait to try it in my codebase, since we use Maybe abstract a lot. Any reason it is in the
issue_4603
instead ofdevelopment
?2a5c5cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to push it to development.