Skip to content

Commit 427de00

Browse files
committed
[Parser] Update requirements for implicit type uses
As an abbreviation, a `typeuse` can be given as just a list of parameters and results, in which case it corresponds to the index of the first function type with the same parameters and results. That function type must also be an MVP function type, i.e. it cannot have a nontrivial rec group, be non-final, or have a declared supertype. The parser did not previously implement all of these rules.
1 parent 881fe6a commit 427de00

4 files changed

Lines changed: 228 additions & 226 deletions

File tree

src/parser/contexts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ struct ParseImplicitTypeDefsCtx : TypeParserCtx<ParseImplicitTypeDefsCtx> {
11191119
types(types), implicitTypes(implicitTypes) {
11201120
for (auto type : types) {
11211121
if (type.isSignature() && type.getRecGroup().size() == 1 &&
1122-
!type.isShared()) {
1122+
!type.getDeclaredSuperType() && !type.isOpen() && !type.isShared()) {
11231123
sigTypes.insert({type.getSignature(), type});
11241124
}
11251125
}

0 commit comments

Comments
 (0)