chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.75k stars 410 forks source link

Add a warning when list initialization involves mismatched parSafe settings #24930

Closed lydia-duncan closed 2 weeks ago

lydia-duncan commented 2 weeks ago

This tripped up a user this week, so we figured a warning would be useful.

Enables the warning to be controlled by a flag, warnForListParsafeMismatch, in case users are intentionally relying on this behavior.

Removed some incorrect documentation about the behavior of the copy initializer, and updated the code within to reflect what the compiler actually does with the type (even though the code itself doesn't impact that, in case adjustments to dyno rely on it in the future).

While here, also fixed a typo I noticed in the existing init= test (which thankfully doesn't change its behavior)

Adds a new test locking in the warning based on the user's reproducer and updates the existing init= test to include the warning when the test exercises it. Also updated a list error message test to not worry about line number changes in the List module.

Passed a full paratest with futures

astatide commented 2 weeks ago

This definitely would have helped me avoid tripping up :joy: I think that's a great warning!