summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 306687bd8..b90081af8 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -682,6 +682,8 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult(
auto typeDef = m_astBuilder->create<TypeAliasDecl>();
typeDef->nameAndLoc.name = getName("Differential");
typeDef->parentDecl = structDecl;
+ addVisibilityModifier(structDecl, getDeclVisibility(parent));
+ addVisibilityModifier(typeDef, getDeclVisibility(parent));
auto synthDeclRef =
createDefaultSubstitutionsIfNeeded(m_astBuilder, this, makeDeclRef(structDecl));
@@ -714,6 +716,7 @@ Expr* SemanticsVisitor::maybeUseSynthesizedDeclForLookupResult(
typeDef->type.type =
calcThisType(subType->getDeclRef().getDecl()->getDefaultDeclRef());
+ addVisibilityModifier(typeDef, getDeclVisibility(parent));
synthesizedDecl = parent;
parent->addDirectMemberDecl(typeDef);
@@ -2085,7 +2088,7 @@ IntVal* SemanticsVisitor::tryConstantFoldDeclRef(
// to not allow such cases.
//
// Note that float-to-inst casts for non-`IntVal`s are allowed.
- if (!isScalarIntegerType(decl->getType()))
+ if (!isValidCompileTimeConstantType(decl->getType()))
{
getSink()->diagnose(declRef, Diagnostics::intValFromNonIntSpecConstEncountered);
return nullptr;