Skip to content

Commit a7f7226

Browse files
authored
fix: Fix assertion on invalid generic operator overloads (#1935)
1 parent a5563f9 commit a7f7226

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
@@ -3173,6 +3173,10 @@ export class Resolver extends DiagnosticEmitter {
31733173
let overloadKind = unchecked(_keys[i]);
31743174
let overloadPrototype = assert(overloadPrototypes.get(overloadKind));
31753175
assert(overloadKind != OperatorKind.INVALID);
3176+
if (overloadPrototype.is(CommonFlags.GENERIC)) {
3177+
// Already errored during initialization: AS212: Decorator '@operator' is not valid here
3178+
continue;
3179+
}
31763180
let operatorInstance: Function | null;
31773181
if (overloadPrototype.is(CommonFlags.INSTANCE)) {
31783182
let boundPrototype = overloadPrototype.toBound(instance);

0 commit comments

Comments
 (0)