You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
akuli@Akuli-ThinkPad:~/jou$ ./jou asd3.jou
compiler error in file "asd3.jou", line 5: cannot assign to a newly calculated value
Attempting this quick and dirty fix...
diff --git a/src/typecheck.c b/src/typecheck.c
index 127a013..be7c777 100644
--- a/src/typecheck.c+++ b/src/typecheck.c@@ -569,12 +569,12 @@ static void typecheck_statement(TypeContext *ctx, const AstStatement *stmt)
break;
case AST_EXPR_GET_FIELD:
case AST_EXPR_DEREF_AND_GET_FIELD:
+ default:
snprintf(
errmsg, sizeof errmsg,
"cannot assign a value of type FROM into field '%s' of type TO",
targetexpr->data.field.fieldname);
break;
- default: assert(0);
}
const ExpressionTypes *targettypes = typecheck_expression(ctx, targetexpr);
typecheck_expression_with_implicit_cast(ctx, valueexpr, targettypes->type, errmsg);
...gives a new error:
akuli@Akuli-ThinkPad:~/jou$ ./jou asd3.jou
compiler error in file "asd3.jou", line 5: cannot assign to a newly calculated value
The text was updated successfully, but these errors were encountered:
Expected result: no error
Actual result:
Attempting this quick and dirty fix...
...gives a new error:
The text was updated successfully, but these errors were encountered: