[Chapel Merge] CG: Implicit inference of implements-statements

Branch: refs/heads/master
Revision: 8900320
Author: vasslitvinov
Log Message:

Merge pull request #16995 from vasslitvinov/infer-implements-decls

CG: Implicit inference of implements-statements

Infer an implements statement, if possible, when there is no explicit
implements statement to satisfy an interface constraint upon a call
to a CG function.

The implementation strategy is to have the compiler create such a
statement under those circumstances and attempt to resolve it.
As a caching strategy, leave it in the AST in either case so that
later inference attempts can find and reuse it. Mark it with prim_error
to indicate unsuccessful resolution attempt.

This implements the semantics presented in #16994 as of this writing.
Given its experimental nature, it is controlled by a developer flag,
which is enabled by default: --infer-implements-decls

The case of nested implementations is currently not working correctly,
as captured in infer-implements-stmt.future

While there: remove an unnecessary restriction on the actual arguments
of implements statements, clean up the license text for the two files
added in #16942, add some bug futures.

r:@mppf

Modified Files:
A test/constrained-generics/basic/error-infer-disabled.chpl
A test/constrained-generics/basic/error-infer-disabled.compopts
A test/constrained-generics/basic/error-infer-disabled.good
A test/constrained-generics/basic/error-infer-empty-ifc.chpl
A test/constrained-generics/basic/error-infer-empty-ifc.good
A test/constrained-generics/basic/infer-implements-stmt.bad
A test/constrained-generics/basic/infer-implements-stmt.chpl
A test/constrained-generics/basic/infer-implements-stmt.future
A test/constrained-generics/basic/infer-implements-stmt.good
A test/constrained-generics/basic/param-implementation-of-non-param.bad
A test/constrained-generics/basic/param-implementation-of-non-param.chpl
A test/constrained-generics/basic/param-implementation-of-non-param.compopts
A test/constrained-generics/basic/param-implementation-of-non-param.future
A test/constrained-generics/basic/param-implementation-of-non-param.good
A test/constrained-generics/basic/param-required-fun.bad
A test/constrained-generics/basic/param-required-fun.chpl
A test/constrained-generics/basic/param-required-fun.future
A test/constrained-generics/basic/param-required-fun.good
A test/constrained-generics/basic/resolve-implements-types.chpl
A test/constrained-generics/basic/resolve-implements-types.good
M compiler/AST/interfaces.cpp
M compiler/include/driver.h
M compiler/include/passes.h
M compiler/include/stmt.h
M compiler/include/visibleFunctions.h
M compiler/main/driver.cpp
M compiler/resolution/cleanups.cpp
M compiler/resolution/interfaceResolution.cpp
M compiler/resolution/visibleFunctions.cpp
M test/constrained-generics/basic/module-with-ifc.bad

Compare: Comparing 962c1038ba6a...890032005df8 · chapel-lang/chapel · GitHub