summaryrefslogtreecommitdiff
path: root/source/slang/core.meta.slang
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2020-06-15 13:56:11 -0700
committerGitHub <noreply@github.com>2020-06-15 13:56:11 -0700
commit926e4bb05402eaf4430e52f0fd07c5da79220322 (patch)
treea22d5e46ae911b70452565e4b6ad1f2c0c8c65bf /source/slang/core.meta.slang
parent7e7425de730d7b3f4590c71111e22e5103b53200 (diff)
parent3461ed41118480c3494f810cddd3cd8c735e2fbb (diff)
Merge branch 'master' into glsl-loop
Diffstat (limited to 'source/slang/core.meta.slang')
-rw-r--r--source/slang/core.meta.slang19
1 files changed, 18 insertions, 1 deletions
diff --git a/source/slang/core.meta.slang b/source/slang/core.meta.slang
index 0c39f2c2f..b56ca3085 100644
--- a/source/slang/core.meta.slang
+++ b/source/slang/core.meta.slang
@@ -192,7 +192,9 @@ ${{{{
// Declare initializers to convert from various other types
for (int ss = 0; ss < kBaseTypeCount; ++ss)
{
- // Don't allow conversion from `void`
+ // Don't allow conversion to or from `void`
+ if (kBaseTypes[tt].tag == BaseType::Void)
+ continue;
if (kBaseTypes[ss].tag == BaseType::Void)
continue;
@@ -250,6 +252,21 @@ ${{{{
${{{{
break;
}
+
+ // If this is the `void` type, then we want to allow
+ // explicit conversion to it from any other type, using
+ // `(void) someExpression`.
+ //
+ if( kBaseTypes[tt].tag == BaseType::Void )
+ {
+}}}}
+ __generic<T>
+ [__readNone]
+ __init(T value)
+ {}
+${{{{
+ }
+
}}}}
}