-
-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typer] disallow static extensions on implicit
this
closes #6036
- Loading branch information
Showing
3 changed files
with
34 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
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,33 @@ | ||
package unit.issues; | ||
|
||
using Lambda; | ||
|
||
private class TYPE { | ||
public function new() {} | ||
public function iterator():Iterator<Int> return new IntIterator(0, 1); | ||
} | ||
|
||
private abstract ABSTRACT(TYPE) { | ||
public var array(get, never):Bool; | ||
function get_array() return true; | ||
|
||
public function new() { | ||
this = new TYPE(); | ||
} | ||
|
||
public function getArray() { | ||
return array; | ||
} | ||
|
||
public function getThisArray() { | ||
return this.array; | ||
} | ||
} | ||
|
||
class Issue6036 extends unit.Test { | ||
function test() { | ||
var a = new ABSTRACT(); | ||
HelperMacros.typedAs(a.getArray(), true); | ||
HelperMacros.typedAs(a.getThisArray(), (null : Void -> Array<Int>)); | ||
} | ||
} |