Skip to content

Commit e73645c

Browse files
dcodeIOromdotdog
authored andcommitted
fix: Fix assertion on invalid generic operator overloads (AssemblyScript#1935)
1 parent 06e30bc commit e73645c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/resolver.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3164,6 +3164,10 @@ export class Resolver extends DiagnosticEmitter {
31643164
let overloadKind = unchecked(_keys[i]);
31653165
let overloadPrototype = assert(overloadPrototypes.get(overloadKind));
31663166
assert(overloadKind != OperatorKind.INVALID);
3167+
if (overloadPrototype.is(CommonFlags.GENERIC)) {
3168+
// Already errored during initialization: AS212: Decorator '@operator' is not valid here
3169+
continue;
3170+
}
31673171
let operatorInstance: Function | null;
31683172
if (overloadPrototype.is(CommonFlags.INSTANCE)) {
31693173
let boundPrototype = overloadPrototype.toBound(instance);

0 commit comments

Comments
 (0)