-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ignore parameter names when type checking arguments (#1052)
Closes #1046 ### Summary of Changes Names of parameters of passed lambdas no longer matter for type checking. The following code is now legal: ``` @pure fun f(callback: (p: Int) -> ()) pipeline myPipeline { f((q) {}); f((q) -> 1); } ```
- Loading branch information
1 parent
f6330a1
commit a1e6717
Showing
4 changed files
with
41 additions
and
9 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
13 changes: 13 additions & 0 deletions
13
...ts/resources/validation/types/checking/arguments/parameter names of callable types.sdsdev
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,13 @@ | ||
package tests.validation.types.checking.arguments.parameterNamesOfCallableTypes | ||
|
||
@Pure fun f(callback: (p: Int) -> (r: Int)) | ||
|
||
segment mySegment() { | ||
// $TEST$ no error r"Expected type .* but got .*\." | ||
f(»(q) { | ||
yield s = 1; | ||
}«); | ||
|
||
// $TEST$ no error r"Expected type .* but got .*\." | ||
f(»(q) -> 1«); | ||
} |