Skip to content

Commit 75890dc

Browse files
authored
fix: proper error for block scoped class expressions (#2012)
1 parent 81c2bad commit 75890dc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/compiler.ts

+10
Original file line numberDiff line numberDiff line change
@@ -3514,6 +3514,16 @@ export class Compiler extends DiagnosticEmitter {
35143514
this.currentType = compiled.type;
35153515
break;
35163516
}
3517+
case NodeKind.CLASS: {
3518+
// TODO: compile as class expression
3519+
this.error(
3520+
DiagnosticCode.Not_implemented_0,
3521+
expression.range,
3522+
"Block-scoped class declarations or expressions"
3523+
);
3524+
expr = this.module.unreachable();
3525+
break;
3526+
}
35173527
default: {
35183528
assert(false);
35193529
expr = this.module.unreachable();

0 commit comments

Comments
 (0)