-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log two new first class procedure tests (#26214)
These tests are based off of #18413, though updated for the new syntax for FCPs (based on the deprecation warnings I encountered when trying to compile them). One of them is a future due to the bug still being present. A fresh checkout of the tests behaved as expected
- Loading branch information
Showing
6 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assignInIfExpr.chpl:6: syntax error: near '{' |
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,7 @@ | ||
// code from https://github.com/chapel-lang/chapel/issues/18413, note that | ||
// it did not compile then either, though at a later point in compilation | ||
var isHammingWeightFixed: bool = true; | ||
|
||
var projFn = if isHammingWeightFixed | ||
then proc(x) { return x; } | ||
else proc(x) { return x; }; |
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,2 @@ | ||
bug: syntax error when assigning fcf via an if expression | ||
#18413 |
Empty file.
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,11 @@ | ||
config var isHammingWeightFixed: bool = true; | ||
|
||
var projFn: proc(x:int): int; | ||
|
||
if isHammingWeightFixed { | ||
projFn = proc(x:int) { return x; }; | ||
} else { | ||
projFn = proc(x:int) { return x+1; }; | ||
} | ||
|
||
writeln(projFn(1)); |
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 @@ | ||
1 |