Skip to content

Commit

Permalink
[Parser] Update requirements for implicit type uses
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlively committed Jun 14, 2024
1 parent 3e83475 commit 807c941
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 226 deletions.
2 changes: 1 addition & 1 deletion src/parser/contexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ struct ParseImplicitTypeDefsCtx : TypeParserCtx<ParseImplicitTypeDefsCtx> {
types(types), implicitTypes(implicitTypes) {
for (auto type : types) {
if (type.isSignature() && type.getRecGroup().size() == 1 &&
!type.isShared()) {
!type.getDeclaredSuperType() && !type.isOpen() && !type.isShared()) {
sigTypes.insert({type.getSignature(), type});
}
}
Expand Down
Loading

0 comments on commit 807c941

Please sign in to comment.