summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-10 13:19:37 -0700
committerGitHub <noreply@github.com>2023-08-10 13:19:37 -0700
commit60ebadab1ec269c7017148a028307a9b5f32b1d4 (patch)
treed6e02ae04c06f4fb433eb36df1f40e0a9c97ab07 /source/slang/slang-check-expr.cpp
parentd4e72a93e13ab880b2f355fb7fb5d55cf0113c3d (diff)
Allow member lookup through modified type. (#3091)
* Allow member lookup through modified type. * Disable `lockFileSync` test. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index e343e3113..05cb6262b 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -3574,7 +3574,12 @@ namespace Slang
Expr* SemanticsExprVisitor::visitMemberExpr(MemberExpr * expr)
{
expr->baseExpression = checkBaseForMemberExpr(expr->baseExpression);
- auto & baseType = expr->baseExpression->type;
+ auto baseType = expr->baseExpression->type;
+
+ // If we are looking up through a modified type, just pass straight
+ // through the inner type.
+ if (auto modifiedType = as<ModifiedType>(baseType))
+ baseType = modifiedType->getBase();
// Note: Checking for vector types before declaration-reference types,
// because vectors are also declaration reference types...