summaryrefslogtreecommitdiff
path: root/tests/bugs/generic-uint-value-param.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs/generic-uint-value-param.slang')
-rw-r--r--tests/bugs/generic-uint-value-param.slang24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/bugs/generic-uint-value-param.slang b/tests/bugs/generic-uint-value-param.slang
new file mode 100644
index 000000000..4d4059732
--- /dev/null
+++ b/tests/bugs/generic-uint-value-param.slang
@@ -0,0 +1,24 @@
+// generic-uint-value-param.slang
+
+//DIAGNOSTIC_TEST:SIMPLE:
+
+// Regression test to confirm that type checker
+// doesn't report warnings for these constant coercions.
+
+struct BoolG<let v : bool>
+{ }
+
+struct Test<let v : uint>
+{
+ int arr[v];
+}
+
+static const uint uv = 5;
+
+void t()
+{
+ BoolG<true> gt;
+ BoolG<bool(1)> gt2;
+ BoolG<1 != 2> gt3;
+ Test<uv> v;
+} \ No newline at end of file