Branch: refs/heads/master
Revision: ed6daeb
Author: vasslitvinov
Log Message:
Merge pull request #17541 from vasslitvinov/ifc-account-for-promotion
IFC: account for promotion
Allow certain cases and avoid compiler crashes when an implementation
of a required function relies on promotion.
For example, in this code:
interface IFC { proc reqFn(arg: Self):Type1; }
proc reqFn(arg: int): Type2 { ... }
implements IFC([1..3] int);
the implements statement relies on promoting reqFn()
.
This is allowed when Type1 and Type2 are void or nothing.
Otherwise, a compiler issues an error currently not implemented
.
The allowed case is exercised by the test:
test/constrained-generics/ucol/jturner/min_concept_void_promote.chpl
Future work: resolve the design questions in #16412 and #17540
and these promotion-related futures:
test/constrained-generics/ucol/cwailes-1/tier_1_auto_promote.chpl
test/constrained-generics/ucol/jturner/min_concept_auto_promote.future
r: mppf
Modified Files:
R test/constrained-generics/ucol/jturner/min_concept_void_promote.bad
R test/constrained-generics/ucol/jturner/min_concept_void_promote.future
M compiler/resolution/interfaceResolution.cpp
M test/constrained-generics/ucol/cwailes-1/tier_1_auto_promote.bad
M test/constrained-generics/ucol/cwailes-1/tier_1_auto_promote.chpl
M test/constrained-generics/ucol/cwailes-1/tier_1_auto_promote.future
M test/constrained-generics/ucol/cwailes-1/tier_1_auto_promote.good
M test/constrained-generics/ucol/jturner/min_concept_auto_promote.bad
M test/constrained-generics/ucol/jturner/min_concept_auto_promote.future
M test/constrained-generics/ucol/jturner/min_concept_auto_promote.good
Compare: https://github.com/chapel-lang/chapel/compare/70239f18d0a0...ed6daebe9c29