summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorDarren Wihandi <65404740+fairywreath@users.noreply.github.com>2025-01-24 16:12:38 -0500
committerGitHub <noreply@github.com>2025-01-24 13:12:38 -0800
commit92c9fffb95c92b0bc07eb1c656375928b5cd5c33 (patch)
tree7faf537e1d56a22cd8e16133867da745b32b2aef /tests/diagnostics
parentac174d260d90b66ebbc8264001a75b9527611cbc (diff)
improve error message on generic value decls (#6169)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/generic-value-parameter-must-have-type.slang21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/diagnostics/generic-value-parameter-must-have-type.slang b/tests/diagnostics/generic-value-parameter-must-have-type.slang
new file mode 100644
index 000000000..a7920b86c
--- /dev/null
+++ b/tests/diagnostics/generic-value-parameter-must-have-type.slang
@@ -0,0 +1,21 @@
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+interface ITest
+{
+ static const uint kValue0;
+ static const uint kValue1;
+};
+
+// `TValue1` does not have an explicit type, this should fail to compile.
+// CHECK: error 30623: a generic value parameter
+// Make sure erroneous code is printed out.
+// CHECK: let TValue1>
+struct TestImpl<let TValue0 : uint, let TValue1> : ITest
+{
+ static const uint kValue0 = TValue0;
+ static const uint kValue1 = TValue1;
+};
+
+void computeMain()
+{
+}