casting only applies to qualified term not a whole expression

This commit is contained in:
Dave Holoway
2020-06-07 13:36:29 +01:00
parent 37dddc48d9
commit 52db53e65a

View File

@@ -1512,7 +1512,7 @@ function rootTerm(tokens, locals, method, imports, typemap) {
if (!type) {
addproblem(tokens, ParseProblem.Error(close_bracket, 'Type expected'));
}
const cast_matches = expression(tokens, locals, method, imports, typemap)
const cast_matches = qualifiedTerm(tokens, locals, method, imports, typemap)
// cast any variables as values with the new type
const vars = cast_matches.variables.map(v => {
if (type && !isTypeCastable(v.type, type)) {