Skip to content

Commit

Permalink
Fix test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhangNV committed Oct 8, 2024
1 parent ce77190 commit 51b7311
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
8 changes: 7 additions & 1 deletion tests/diagnostics/mismatching-types.slang
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ void main(uint3 dispatchThreadID : SV_DispatchThreadID)

// expected an expression of type 'GenericOuter<int>', got 'int'
a = 0;

// expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'int'
// explicit conversion from 'int' to 'GenericOuter<int>.GenericInner<int>' is possible
a.g = 0;

// expected an expression of type 'GenericOuter<int>.NonGenericInner', got 'int'
// explicit conversion from 'int' to 'GenericOuter<int>.NonGenericInner' is possible
a.ng = 0;
// expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'GenericOuter<float>.GenericInner<float>'
a.g = b.g;
Expand All @@ -61,7 +65,9 @@ void main(uint3 dispatchThreadID : SV_DispatchThreadID)
c.i = 0;
// expected an expression of type 'NonGenericOuter.GenericInner<int>', got 'NonGenericOuter.GenericInner<float>'
c.i = c.f;

// expected an expression of type 'NonGenericOuter.GenericInner<int>.ReallyNested', got 'int'
// explicit conversion from 'int' to 'GenericInner<int>.ReallyNested' is possible
c.i.n = 0;
// OK
c.i.n.val = 0;
Expand All @@ -74,4 +80,4 @@ void main(uint3 dispatchThreadID : SV_DispatchThreadID)
Texture1D<int> t1 = tex;
// expected an expression of type 'Texture2D<float>', got 'Texture1D<float>'
Texture2D<float> t2 = tex;
}
}
21 changes: 12 additions & 9 deletions tests/diagnostics/mismatching-types.slang.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@ standard error = {
tests/diagnostics/mismatching-types.slang(51): error 30019: expected an expression of type 'GenericOuter<int>', got 'int'
a = 0;
^
tests/diagnostics/mismatching-types.slang(53): error 30019: expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'int'
tests/diagnostics/mismatching-types.slang(55): error 30019: expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'int'
a.g = 0;
^
tests/diagnostics/mismatching-types.slang(55): error 30019: expected an expression of type 'GenericOuter<int>.NonGenericInner', got 'int'
tests/diagnostics/mismatching-types.slang(55): note: explicit conversion from 'int' to 'GenericOuter<int>.GenericInner<int>' is possible
tests/diagnostics/mismatching-types.slang(59): error 30019: expected an expression of type 'GenericOuter<int>.NonGenericInner', got 'int'
a.ng = 0;
^
tests/diagnostics/mismatching-types.slang(57): error 30019: expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'GenericOuter<float>.GenericInner<float>'
tests/diagnostics/mismatching-types.slang(59): note: explicit conversion from 'int' to 'GenericOuter<int>.NonGenericInner' is possible
tests/diagnostics/mismatching-types.slang(61): error 30019: expected an expression of type 'GenericOuter<int>.GenericInner<int>', got 'GenericOuter<float>.GenericInner<float>'
a.g = b.g;
^
tests/diagnostics/mismatching-types.slang(59): error 30019: expected an expression of type 'GenericOuter<int>.NonGenericInner', got 'GenericOuter<float>.NonGenericInner'
tests/diagnostics/mismatching-types.slang(63): error 30019: expected an expression of type 'GenericOuter<int>.NonGenericInner', got 'GenericOuter<float>.NonGenericInner'
a.ng = b.ng;
^~
tests/diagnostics/mismatching-types.slang(61): error 30019: expected an expression of type 'GenericInner<int>', got 'int'
tests/diagnostics/mismatching-types.slang(65): error 30019: expected an expression of type 'GenericInner<int>', got 'int'
c.i = 0;
^
tests/diagnostics/mismatching-types.slang(63): error 30019: expected an expression of type 'GenericInner<int>', got 'GenericInner<float>'
tests/diagnostics/mismatching-types.slang(67): error 30019: expected an expression of type 'GenericInner<int>', got 'GenericInner<float>'
c.i = c.f;
^
tests/diagnostics/mismatching-types.slang(65): error 30019: expected an expression of type 'GenericInner<int>.ReallyNested', got 'int'
tests/diagnostics/mismatching-types.slang(71): error 30019: expected an expression of type 'GenericInner<int>.ReallyNested', got 'int'
c.i.n = 0;
^
tests/diagnostics/mismatching-types.slang(74): error 30019: expected an expression of type 'Texture1D<int>', got 'Texture1D<float>'
tests/diagnostics/mismatching-types.slang(71): note: explicit conversion from 'int' to 'GenericInner<int>.ReallyNested' is possible
tests/diagnostics/mismatching-types.slang(80): error 30019: expected an expression of type 'Texture1D<int>', got 'Texture1D<float>'
Texture1D<int> t1 = tex;
^~~
tests/diagnostics/mismatching-types.slang(76): error 30019: expected an expression of type 'Texture2D<float>', got 'Texture1D<float>'
tests/diagnostics/mismatching-types.slang(82): error 30019: expected an expression of type 'Texture2D<float>', got 'Texture1D<float>'
Texture2D<float> t2 = tex;
^~~
}
Expand Down
6 changes: 6 additions & 0 deletions tests/diagnostics/variable-redeclaration.slang.expected
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ tests/diagnostics/variable-redeclaration.slang(44): error 30200: declaration of
tests/diagnostics/variable-redeclaration.slang(43): note: see previous declaration of 'f'
int f;
^
tests/diagnostics/variable-redeclaration.slang(41): error 30200: declaration of 'f' conflicts with existing declaration
struct S
^
tests/diagnostics/variable-redeclaration.slang(41): note: see previous declaration of 'f'
struct S
^
tests/diagnostics/variable-redeclaration.slang(51): error 30200: declaration of 'size' conflicts with existing declaration
float size)
^~~~
Expand Down

0 comments on commit 51b7311

Please sign in to comment.