-
-
Notifications
You must be signed in to change notification settings - Fork 661
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typer] don't eagerly display in check_error
We might want to raise instead if we're in_call_args in order to support overload resolution. closes #11274
- Loading branch information
Showing
3 changed files
with
36 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
Main.hx:4: characters 13-17 : Cannot use null as ternary condition | ||
Main.hx:4: characters 13-17 : Cannot use null as ternary condition | ||
Main.hx:4: characters 13-17 : ... For function argument 'v' |
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,33 @@ | ||
package unit.issues; | ||
|
||
using unit.issues.Issue11274.SpriteTools; | ||
|
||
private class Sprite { | ||
public function new() {} | ||
} | ||
|
||
private class SpriteTools { | ||
public static function setName(sprite:Sprite, name:String):Void {} | ||
} | ||
|
||
class Issue11274 extends unit.Test { | ||
static var mark = false; | ||
|
||
function test() { | ||
sprite(foo -> { | ||
foo.setName("foo"); | ||
add(foo); // err | ||
}); | ||
t(mark); | ||
} | ||
|
||
extern inline overload static function sprite(callback:(sprite:Sprite) -> Void) { | ||
callback(new Sprite()); | ||
} | ||
|
||
extern inline overload static function sprite(name:String, callback:(sprite:Sprite) -> Void) {} | ||
|
||
static function add(sprite:Sprite):Void { | ||
mark = true; | ||
} | ||
} |