summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-06-30 14:32:50 -0700
committerGitHub <noreply@github.com>2025-06-30 21:32:50 +0000
commitf28f67d988158d6c46f7ffe967152f98d32a37b2 (patch)
tree2aa620986a87ec69cf1f210c714312e42b62ac9e /source/slang/slang-check-expr.cpp
parenta55ff722cae338a8fcf5402858c47cf0650a8e5e (diff)
Add MLP training examples. (#7550)
* Add MLP training examples. * Formatting fix. * Fix. * Improve documentation on coopvector. * Improve doc. * Update doc. * Fix typo. * Cleanup shader. * Cleanup. * Fix test. * Fix type check recursion. * Fix. * Fix. * Fix override check.
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;