summaryrefslogtreecommitdiff
path: root/tests/diagnostics/extension-full-name.slang.expected
diff options
context:
space:
mode:
authorHarsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>2025-04-24 10:11:30 +0530
committerGitHub <noreply@github.com>2025-04-24 04:41:30 +0000
commitb78a8ba006fc9253cd1fd88fb7dd1eacfa749dfa (patch)
treef82da8185be49dff6791306b6466155d20ca6fb8 /tests/diagnostics/extension-full-name.slang.expected
parent785669c8771c01d57914ec0075315e8ae61b6a31 (diff)
Fix #6544: Properly format nested type names in extensions (#6769)
* Fix #6544: Properly format nested type names in extensions Modify DeclRefBase::toText to properly handle types defined in extensions by qualifying them with their parent type name. This ensures getFullName() returns the full name like 'FullPrecisionOptimizer<half>.State' instead of just '.State'. Also handle other nested types in structs/classes similarly. * Update extension reflection handling - with generics args and namespaces - stopping namespace inclusion for extension members - Update to use getTargetType() to handle the generic arguments - update test cases * Simplify code to remove using parentDecl
Diffstat (limited to 'tests/diagnostics/extension-full-name.slang.expected')
-rw-r--r--tests/diagnostics/extension-full-name.slang.expected41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/diagnostics/extension-full-name.slang.expected b/tests/diagnostics/extension-full-name.slang.expected
new file mode 100644
index 000000000..8001298c1
--- /dev/null
+++ b/tests/diagnostics/extension-full-name.slang.expected
@@ -0,0 +1,41 @@
+result code = -1
+standard error = {
+tests/diagnostics/extension-full-name.slang(184): error 30019: expected an expression of type 'GenericType<half>.State', got 'int'
+ state1 = 0; // Error: expected expr of type 'GenericType<half>.State', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(185): error 30019: expected an expression of type 'GenericType<float>.InnerType.Options', got 'int'
+ options1 = 0; // Error: expected expr of type 'GenericType<float>.InnerType.Options', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(186): error 30019: expected an expression of type 'NonGenericType.Config', got 'int'
+ config1 = 0; // Error: expected expr of type 'NonGenericType.Config', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(187): error 30019: expected an expression of type 'Container.Nested.Settings', got 'int'
+ settings1 = 0; // Error: expected expr of type 'Container.Nested.Settings', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(188): error 30019: expected an expression of type 'Container.Nested.DeepNested.Record', got 'int'
+ record1 = 0; // Error: expected expr of type 'Container.Nested.DeepNested.Record', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(196): error 30027: 'getOptions' is not a member of 'GenericType<int>.InnerType'.
+ intInner.getOptions(); // This won't compile as intInner doesn't have getOptions
+ ^~~~~~~~~~
+tests/diagnostics/extension-full-name.slang(226): error 30019: expected an expression of type 'GenericType<float>.InnerType.Options', got 'GenericType<half>.State'
+ .createState(); // Error: expected expr of type 'GenericType<float>.InnerType.Options',
+ ^
+tests/diagnostics/extension-full-name.slang(228): error 30019: expected an expression of type 'GenericType<half>.State', got 'NonGenericType.Config'
+ state1 = nonGenType.createConfig(); // Error: expected expr of type 'GenericType<half>.State',
+ ^
+tests/diagnostics/extension-full-name.slang(230): error 30019: expected an expression of type 'NonGenericType.Config', got 'Container.Nested.Settings'
+ config1 = nested.createSettings(); // Error: expected expr of type 'NonGenericType.Config', got
+ ^
+tests/diagnostics/extension-full-name.slang(304): error 30019: expected an expression of type 'Bar[3].DataStats', got 'int'
+ barStats = 0; // Error: expected expr of type 'Bar[3].DataStats', got 'int'
+ ^
+tests/diagnostics/extension-full-name.slang(312): error 30019: expected an expression of type 'Bar[2].DataStats', got 'Bar[3].DataStats'
+ bar2Stats = barArray.computeStats(); // Error: expected expr of type 'Bar[2].DataStats', got 'Bar[3].DataStats'
+ ^
+tests/diagnostics/extension-full-name.slang(355): error 30019: expected an expression of type 'SimpleBase.NamedConfig', got 'int'
+ config = 0; // Error: expected expr of type 'SimpleBase.NamedConfig', got 'int'
+ ^
+}
+standard output = {
+}