summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-check-constraint.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/slang/slang-check-constraint.cpp b/source/slang/slang-check-constraint.cpp
index d66bf35cc..e7eccfaec 100644
--- a/source/slang/slang-check-constraint.cpp
+++ b/source/slang/slang-check-constraint.cpp
@@ -705,14 +705,16 @@ namespace Slang
auto fstDeclRef = fstDeclRefType->getDeclRef();
if (auto typeParamDecl = as<GenericTypeParamDecl>(fstDeclRef.getDecl()))
- return TryUnifyTypeParam(constraints, typeParamDecl, snd);
+ if (typeParamDecl->parentDecl == constraints.genericDecl)
+ return TryUnifyTypeParam(constraints, typeParamDecl, snd);
if (auto sndDeclRefType = as<DeclRefType>(snd))
{
auto sndDeclRef = sndDeclRefType->getDeclRef();
if (auto typeParamDecl = as<GenericTypeParamDecl>(sndDeclRef.getDecl()))
- return TryUnifyTypeParam(constraints, typeParamDecl, fst);
+ if (typeParamDecl->parentDecl == constraints.genericDecl)
+ return TryUnifyTypeParam(constraints, typeParamDecl, fst);
// can't be unified if they refer to different declarations.
if (fstDeclRef.getDecl() != sndDeclRef.getDecl()) return false;
@@ -816,7 +818,7 @@ namespace Slang
if (auto typeParamDecl = as<GenericTypeParamDecl>(fstDeclRef.getDecl()))
{
- if(typeParamDecl->parentDecl == constraints.genericDecl )
+ if(typeParamDecl->parentDecl == constraints.genericDecl)
return TryUnifyTypeParam(constraints, typeParamDecl, snd);
}
}
@@ -827,7 +829,7 @@ namespace Slang
if (auto typeParamDecl = as<GenericTypeParamDecl>(sndDeclRef.getDecl()))
{
- if(typeParamDecl->parentDecl == constraints.genericDecl )
+ if(typeParamDecl->parentDecl == constraints.genericDecl)
return TryUnifyTypeParam(constraints, typeParamDecl, fst);
}
}