summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2017-11-04 06:57:48 -0400
committerYong He <yonghe@outlook.com>2017-11-04 06:57:48 -0400
commit76db3636418f1667db1c8b0d3b6cfec6c652cc84 (patch)
treeefae3c353e750e19e5e06ee19fab55a71b776adf /source/slang/syntax.cpp
parent0a3656788473244b4760791c4129a4080a6631f6 (diff)
work in-progress
Diffstat (limited to 'source/slang/syntax.cpp')
-rw-r--r--source/slang/syntax.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp
index 2f3368f4c..24d508ed5 100644
--- a/source/slang/syntax.cpp
+++ b/source/slang/syntax.cpp
@@ -1213,7 +1213,7 @@ void Type::accept(IValVisitor* visitor, void* extra)
}
if (!outer)
- return !subst->outer;
+ return !subst->outer || subst->outer.As<ThisTypeSubstitution>();
if (!outer->Equals(subst->outer.Ptr()))
return false;
@@ -1258,19 +1258,9 @@ void Type::accept(IValVisitor* visitor, void* extra)
bool ThisTypeSubstitution::Equals(Substitutions* subst)
{
- // both must be NULL, or non-NULL
- if (!this || !subst)
- return !this && !subst;
- auto thisSubst = dynamic_cast<ThisTypeSubstitution*>(subst);
- if (!thisSubst)
- return false;
- if (!sourceType && thisSubst->sourceType || sourceType && !thisSubst->sourceType)
- return false;
- if (thisSubst->sourceType && !thisSubst->sourceType->EqualsVal(sourceType))
- return false;
- if (!outer->Equals(subst->outer.Ptr()))
- return false;
- return true;
+ if (subst && dynamic_cast<ThisTypeSubstitution*>(subst))
+ return true;
+ return false;
}