Branch: refs/heads/master
Revision: 281056e
Author: vasslitvinov
Log Message:
Merge pull request #16942 from vasslitvinov/constrained-generics-3
Initial implementation of Constrained Generics (CG)
This PR introduces Constrained Generics (CG) with interfaces and interface constraints.
It provides a straw-person implementation of bare-bones essential functionality.
Note: this introduces two new keywords: interface
and implements
Implementation details of a slightly earlier version are presented in the PR #16813,
which is superseded by this PR.
While there:
- Reformatted BaseAST::astTagAsString() for readability.
- Removed a piece of dead code in ResolutionCandidate.cpp
Detailed development history is partly available in:
f48a0a0a31…8d19bb82bd , f48a0a0a31…a2021610e1 , f48a0a0a31…9764de6a3e
Next steps after the merge:
-
Add the tests from the earlier CG effort, see
chapel/test/interfaces at chriswailes_ast_integration · mppf/chapel · GitHub -
The TODOs in compiler comments that are annotated with “CG TODO”.
-
Implement interfaces in nested / function scopes.
For that, we will need to implement, for example, InterfaceSymbol::copyInner()
r: @mppf
Modified Files:
A compiler/AST/interfaces.cpp
A compiler/resolution/interfaceResolution.cpp
A test/constrained-generics/basic/basic-arg-dot-type.bad
A test/constrained-generics/basic/basic-arg-dot-type.chpl
A test/constrained-generics/basic/basic-arg-dot-type.future
A test/constrained-generics/basic/basic-arg-dot-type.good
A test/constrained-generics/basic/basic-arg-query.chpl
A test/constrained-generics/basic/basic-arg-query.good
A test/constrained-generics/basic/basic-general-form.chpl
A test/constrained-generics/basic/basic-general-form.good
A test/constrained-generics/basic/basic-override-dfltimpl.chpl
A test/constrained-generics/basic/basic-override-dfltimpl.good
A test/constrained-generics/basic/basic-ref-args.chpl
A test/constrained-generics/basic/basic-ref-args.good
A test/constrained-generics/basic/call-likenamed-nonifc-fun.chpl
A test/constrained-generics/basic/call-likenamed-nonifc-fun.good
A test/constrained-generics/basic/error-call-ug.chpl
A test/constrained-generics/basic/error-call-ug.good
A test/constrained-generics/basic/error-cg-arg.chpl
A test/constrained-generics/basic/error-cg-arg.good
A test/constrained-generics/basic/error-concrete-arg.chpl
A test/constrained-generics/basic/error-concrete-arg.good
A test/constrained-generics/basic/error-implements-constraint.chpl
A test/constrained-generics/basic/error-implements-constraint.good
A test/constrained-generics/basic/error-implements-stmt.chpl
A test/constrained-generics/basic/error-implements-stmt.good
A test/constrained-generics/basic/error-two-ifc-one-arg-dfltImpl.chpl
A test/constrained-generics/basic/error-two-ifc-one-arg-dfltImpl.good
A test/constrained-generics/basic/error-two-ifc-one-arg-reqfun.chpl
A test/constrained-generics/basic/error-two-ifc-one-arg-reqfun.good
A test/constrained-generics/basic/module-with-ifc.bad
A test/constrained-generics/basic/module-with-ifc.chpl
A test/constrained-generics/basic/module-with-ifc.future
A test/constrained-generics/basic/module-with-ifc.good
A test/constrained-generics/basic/self-arg-query.chpl
A test/constrained-generics/basic/self-arg-query.good
A test/constrained-generics/basic/self-call-ug.chpl
A test/constrained-generics/basic/self-call-ug.good
A test/constrained-generics/basic/sugar-arg-ifc-type.chpl
A test/constrained-generics/basic/sugar-arg-ifc-type.good
A test/constrained-generics/basic/two-args-one-ifc.chpl
A test/constrained-generics/basic/two-args-one-ifc.good
A test/constrained-generics/basic/two-args-two-ifc-ds.chpl
A test/constrained-generics/basic/two-args-two-ifc-ds.good
A test/constrained-generics/basic/two-args-two-ifc-sd.chpl
A test/constrained-generics/basic/two-args-two-ifc-sd.good
A test/constrained-generics/basic/two-formals.chpl
A test/constrained-generics/basic/two-formals.good
A test/constrained-generics/basic/two-ifc-one-arg.chpl
A test/constrained-generics/basic/two-ifc-one-arg.good
M compiler/AST/AstCount.cpp
M compiler/AST/AstDumpToNode.cpp
M compiler/AST/AstLogger.cpp
M compiler/AST/AstPrintDocs.cpp
M compiler/AST/AstVisitorTraverse.cpp
M compiler/AST/CollapseBlocks.cpp
M compiler/AST/FnSymbol.cpp
M compiler/AST/Makefile.share
M compiler/AST/alist.cpp
M compiler/AST/baseAST.cpp
M compiler/AST/primitive.cpp
M compiler/AST/type.cpp
M compiler/codegen/expr.cpp
M compiler/codegen/stmt.cpp
M compiler/codegen/type.cpp
M compiler/include/AstCount.h
M compiler/include/AstDumpToNode.h
M compiler/include/AstLogger.h
M compiler/include/AstPrintDocs.h
M compiler/include/AstVisitor.h
M compiler/include/AstVisitorTraverse.h
M compiler/include/CollapseBlocks.h
M compiler/include/FnSymbol.h
M compiler/include/ResolutionCandidate.h
M compiler/include/alist.h
M compiler/include/baseAST.h
M compiler/include/bison-chapel.h
M compiler/include/expr.h
M compiler/include/flags_list.h
M compiler/include/flex-chapel.h
M compiler/include/passes.h
M compiler/include/primitive_list.h
M compiler/include/resolution.h
M compiler/include/stmt.h
M compiler/include/symbol.h
M compiler/include/type.h
M compiler/parser/bison-chapel.cpp
M compiler/parser/chapel.lex
M compiler/parser/chapel.ypp
M compiler/parser/flex-chapel.cpp
M compiler/passes/checkParsed.cpp
M compiler/passes/normalize.cpp
M compiler/passes/scopeResolve.cpp
M compiler/resolution/Makefile.share
M compiler/resolution/ResolutionCandidate.cpp
M compiler/resolution/cleanups.cpp
M compiler/resolution/functionResolution.cpp
M compiler/resolution/generics.cpp
M compiler/util/misc.cpp
Compare: Comparing 14bc10dcf818...281056e9ae4e · chapel-lang/chapel · GitHub