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.
Make default initialization of low and high bounded ranges unstable (c…
…hapel-lang#23299) Per the discussion [here](chapel-lang#21474), make default initialization of low and high bounded ranges unstable. The following will produce ranges with the values `0..` and `..1` respectively; however, we may want to change the default values in the future or make them implementation dependant, so an unstable warning will be emitted for each. ```chapel var rl: range(int, boundKind.low), rh: range(int, boundKind.high); ``` - [x] local paratest - [x] gasnet paratest [ Reviewed by @jabraham17 ] - Thanks!
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
// only low and high default initialization should be unstable | ||
var drlb: range(int, boundKind.low), | ||
drub: range(int, boundKind.high), | ||
drnb: range(int, boundKind.neither), | ||
drbb: range(int, boundKind.both); | ||
|
||
// none of these should produce an unstable warning | ||
var rlb = 1.., | ||
rub = ..0, | ||
rnb = .., | ||
rbb = 1..0; | ||
|
||
writeln(drlb); | ||
writeln(drub); |
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,4 @@ | ||
1.. | ||
..0 | ||
defaultUnboundedRange.chpl:3: warning: Default initialization of a range with 'boundKind.low' or 'boundKind.high' is unstable | ||
defaultUnboundedRange.chpl:4: warning: Default initialization of a range with 'boundKind.low' or 'boundKind.high' is unstable |