summaryrefslogtreecommitdiff
path: root/tests/diagnostics/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'tests/diagnostics/interfaces')
-rw-r--r--tests/diagnostics/interfaces/return-type-mismatch.slang20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/diagnostics/interfaces/return-type-mismatch.slang b/tests/diagnostics/interfaces/return-type-mismatch.slang
new file mode 100644
index 000000000..244f2f18e
--- /dev/null
+++ b/tests/diagnostics/interfaces/return-type-mismatch.slang
@@ -0,0 +1,20 @@
+// return-type-mismatch.slang
+
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+
+enum LobeTypes : uint32_t { None = 0, Diffuse = 1 }
+
+interface IMaterialInstance {
+ LobeTypes get_lobe_types();
+}
+
+struct Broken : IMaterialInstance {
+ // CHECK: ([[# @LINE+1]]): error 38106:
+ uint get_lobe_types() { return LobeTypes::Diffuse; }
+}
+
+int test()
+{
+ Broken b;
+ return 0;
+} \ No newline at end of file