-
-
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.
[hxb] detect need for local context in nested anons (#11617)
* [hxb] detect need for local context in nested anons * [hxb] add compiler failure message * [tests] add tests for 11589 * [tests] add original Hide issue too * [hxb] handle another edge case
- Loading branch information
Showing
6 changed files
with
75 additions
and
15 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,27 @@ | ||
package cases.issues; | ||
|
||
class Issue11589 extends TestCase { | ||
function test(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11589/Main.hx")); | ||
var args = ["--main", "Main.hx", "--no-output"]; | ||
runHaxe(args); | ||
runHaxe(args); | ||
Assert.isFalse(lastResult.hasError); | ||
} | ||
|
||
function testNestedField(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11589/Main1.hx")); | ||
var args = ["--main", "Main.hx", "--no-output"]; | ||
runHaxe(args); | ||
runHaxe(args); | ||
Assert.isFalse(lastResult.hasError); | ||
} | ||
|
||
function testNestedFieldUsed(_) { | ||
vfs.putContent("Main.hx", getTemplate("issues/Issue11589/Main2.hx")); | ||
var args = ["--main", "Main.hx", "--no-output"]; | ||
runHaxe(args); | ||
runHaxe(args); | ||
Assert.isFalse(lastResult.hasError); | ||
} | ||
} |
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,3 @@ | ||
function main() {} | ||
|
||
typedef Foo<T> = {} & { foo:T } |
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,8 @@ | ||
function main() {} | ||
|
||
typedef Foo<T> = { foo : { bar : T } } | ||
|
||
typedef Bar<T> = { | ||
function foo( elements : Array<{ value : T }> ) : Void; | ||
function bar( foo : T, bar : { baz : Bool } ) : Void; | ||
} |
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,6 @@ | ||
function main() { | ||
foo(""); | ||
} | ||
|
||
function foo<T>(v:T):Foo<T> return {foo:{bar:v}} | ||
typedef Foo<T> = { foo : { bar : T } } |