[Chapel Merge] Improve void and nothing handling #17007

Branch: refs/heads/master
Revision: 39037b7
Author: leekillough
Log Message:

Merge pull request #17007 from leekillough/prohibit_void_vars

Improve void and nothing handling #17007

[reviewed by @mppf]

Fixes #14995

Improves error messages regarding void and nothing, by disallowing void variables, void formals, and void aggregate fields, and by diagnosing the errors correctly, instead of displaying secondary errors. void is still allowed to be passed to and returned from functions as a type.

Renames resolution cleanup functions and void tests to use nothing instead of void in their file/function names and comments, since they really apply to nothing instead of to void.

Merges nothing-returning PRIM_RETURN and PRIM_YIELD cleanup handling into one merged switch case.

Fixes some tests to use nothing instead of void, now that void is illegal in the test’s context.

Fixes internal ChapelBase module to disallow assignment to nothing variables and print its compilerError messages – previously, a secondary error during function resolution would eclipse the module’s compilerError.

Fixes a compiler segfault when --minimal-modules is specified and the chpl__autoDestroy function isn’t defined.

Fixes a compiler segfault when a missing source filename is used in combination with --ignore-errors-for-pass.

Modified Files:
A test/types/void/nothing-assign.chpl
A test/types/void/nothing-assign.compopts
A test/types/void/nothing-assign.good
A test/types/void/nothing-variable-def.chpl
A test/types/void/nothing-variable-def.good
A test/types/void/nothing-variable-use-1.chpl
A test/types/void/nothing-variable-use-1.good
A test/types/void/nothing-variable-use-2.chpl
A test/types/void/nothing-variable-use-2.good
A test/types/void/nothing-variable-use-3.chpl
A test/types/void/nothing-variable-use-3.good
A test/types/void/void-field-1.chpl
A test/types/void/void-field-1.good
A test/types/void/void-field-2.chpl
A test/types/void/void-field-2.good
A test/types/void/void-field-3.chpl
A test/types/void/void-field-3.good
A test/types/void/void-field-4.chpl
A test/types/void/void-field-4.good
A test/types/void/void-field-5.chpl
A test/types/void/void-field-5.good
A test/types/void/void-field-6.chpl
A test/types/void/void-field-6.good
A test/types/void/void-field-7.chpl
A test/types/void/void-field-7.good
A test/types/void/void-field-8.chpl
A test/types/void/void-field-8.good
A test/types/void/void-field-9.chpl
A test/types/void/void-field-9.good
A test/types/void/void-formal-1.chpl
A test/types/void/void-formal-1.good
A test/types/void/void-formal-2.chpl
A test/types/void/void-formal-2.good
A test/types/void/void-formal-3.chpl
A test/types/void/void-formal-3.good
A test/types/void/void-formal-4.chpl
A test/types/void/void-formal-4.good
R test/types/void/void-assign.chpl
R test/types/void/void-assign.compopts
R test/types/void/void-assign.good
R test/types/void/void-variable-def.chpl
R test/types/void/void-variable-def.good
R test/types/void/void-variable-use-1.chpl
R test/types/void/void-variable-use-1.good
R test/types/void/void-variable-use-2.chpl
R test/types/void/void-variable-use-2.good
R test/types/void/void-variable-use-3.chpl
R test/types/void/void-variable-use-3.good
M compiler/include/resolution.h
M compiler/resolution/cleanups.cpp
M compiler/resolution/functionResolution.cpp
M compiler/resolution/implementForallIntents.cpp
M compiler/resolution/resolveFunction.cpp
M compiler/util/files.cpp
M test/library/packages/DistributedIters/checkBadInput-dynamic.chpl
M test/library/packages/DistributedIters/checkBadInput-guided.chpl

Compare: Comparing c0ac201a42ae...39037b764227 · chapel-lang/chapel · GitHub