-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eagerly check listing/mapping in iterables (#752)
There is currently a bug around resolving variables within the iterable of a for generator or spread syntax (#741) Normally, mappings/listings are type-checked lazily. However, this results in the said bug getting widened, for any object members declared in the iterable. As a workaround for now, prevent the bug from being any worse by ensuring that these object members are eagerly typechecked.
- Loading branch information
Showing
10 changed files
with
126 additions
and
11 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
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
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
33 changes: 33 additions & 0 deletions
33
...core/src/test/files/LanguageSnippetTests/input/generators/forGeneratorNestedReference.pkl
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 @@ | ||
class Aviary { | ||
birds: Listing<Bird> | ||
} | ||
|
||
class Bird { | ||
age: Int | ||
} | ||
|
||
function Bird(_age: Int) = new Bird { age = _age } | ||
|
||
res1 { | ||
for (i in IntSeq(1, 1)) { | ||
for (j in | ||
new Aviary { | ||
birds { | ||
Bird(i) | ||
} | ||
}.birds | ||
) { | ||
j | ||
} | ||
} | ||
} | ||
|
||
res2 { | ||
for (i in IntSeq(1, 1)) { | ||
...new Aviary { | ||
birds { | ||
Bird(i) | ||
} | ||
}.birds | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ore/src/test/files/LanguageSnippetTests/output/generators/forGeneratorNestedReference.pcf
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,10 @@ | ||
res1 { | ||
new { | ||
age = 1 | ||
} | ||
} | ||
res2 { | ||
new { | ||
age = 1 | ||
} | ||
} |