forked from chapel-lang/chapel
-
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.
Fix a bug causing generic variables used in a
coforall
to crash com…
…pilation (chapel-lang#24301) Resolves chapel-lang#21272. Fix a bug that caused a generic class variable mentioned in a `coforall` to crash the program with an internal assertion. Remove the internal assertion. It asserts that actuals passed to a task function are not generic, but it is possible for this to be the case if we are already in an error state. In that case, we should continue to the end of the pass rather than crash. While here, adjust the class section of the spec to indicate that for a class type `C`, the expression `C` is taken to mean generic management except in the `new` expression, where it implies `owned C`. TESTING - [x] `linux64`, `standard` Reviewed by @vasslitvinov. Thanks!
- Loading branch information
Showing
4 changed files
with
27 additions
and
4 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,15 @@ | ||
class MyClass { | ||
proc func() { | ||
return 2 + 2; | ||
} | ||
} | ||
|
||
// Split-init error should fire at this point. It would be nice if the error | ||
// would mention a note about the use within the `coforall`, but that isn't | ||
// necessary - and would require modification to map `m` to temporaries | ||
// introduced for the `coforall` block function. | ||
var m: MyClass; | ||
|
||
coforall idx in 0..3 { | ||
m.func(); | ||
} |
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 @@ | ||
CoforallDefaultInitBug.chpl:13: error: cannot default-initialize a variable with generic type | ||
CoforallDefaultInitBug.chpl:13: note: 'm' has generic type 'MyClass' | ||
CoforallDefaultInitBug.chpl:13: note: cannot find initialization point to split-init this variable |