refactor(compiler): add details while throw error during expression convert (#32760)
Fixes #32759 PR Close #32760
This commit is contained in:
@ -551,7 +551,10 @@ class _AstToIrVisitor implements cdAst.AstVisitor {
|
||||
this.usesImplicitReceiver = prevUsesImplicitReceiver;
|
||||
} else {
|
||||
// Otherwise it's an error.
|
||||
throw new Error('Cannot assign to a reference or variable!');
|
||||
const receiver = ast.name;
|
||||
const value = (ast.value instanceof cdAst.PropertyRead) ? ast.value.name : undefined;
|
||||
throw new Error(
|
||||
`Cannot assign value "${value}" to template variable "${receiver}". Template variables are read-only.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user