Skip to content

Commit

Permalink
Semantic: fix undefined type crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Mar 18, 2024
1 parent 5a4f917 commit f2c6994
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/semantic/expr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ export const checkOperand = (operand: Operand, ctx: Context): void => {
export const checkUnaryExpr = (unaryExpr: UnaryExpr, ctx: Context): void => {
switch (unaryExpr.op.kind) {
case 'method-call-op':
unaryExpr.type = checkMethodCall(unaryExpr, unaryExpr.op, ctx)
unaryExpr.type = checkMethodCall(unaryExpr, unaryExpr.op, ctx) ?? unknownType
return
case 'field-access-op':
unaryExpr.type = checkFieldAccess(unaryExpr.operand, unaryExpr.op.name, ctx)
unaryExpr.type = checkFieldAccess(unaryExpr.operand, unaryExpr.op.name, ctx) ?? unknownType
return
case 'call-op':
checkCall(unaryExpr, ctx)
Expand Down

0 comments on commit f2c6994

Please sign in to comment.