diff options
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
| -rw-r--r-- | source/slang/slang-check-expr.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index e88db59f8..29747b7d5 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -4172,6 +4172,16 @@ namespace Slang return CreateErrorExpr(expr); } + Expr* SemanticsExprVisitor::visitCastToSuperTypeExpr(CastToSuperTypeExpr* expr) + { + // CastToSuperType is effectively a struct field. + // As long as the type is not readonly tagged we + // can use CastToSuperType as an L-value + if(!expr->type.hasReadOnlyOnTarget) + expr->type.isLeftValue = true; + return expr; + } + Expr* SemanticsExprVisitor::visitReturnValExpr(ReturnValExpr* expr) { auto scope = expr->scope; |
