-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open existential on arguments after overload resolution. (#4982)
* Open existential on arguments after overload resolution. * Fix. * Update source/slang/slang-check-overload.cpp Co-authored-by: ArielG-NV <[email protected]> --------- Co-authored-by: ArielG-NV <[email protected]>
- Loading branch information
Showing
3 changed files
with
84 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHK): -d3d12 -compute -shaderobj -output-using-type | ||
//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHK): -vk -compute -shaderobj -output-using-type | ||
|
||
|
||
// Test that we can synthesize a [mutating] interface requirement from a nonmutating implementation, | ||
// and the interface requirement signature contains an output interface-typed parameter. | ||
|
||
//TEST_INPUT: ubuffer(data=[0 0], stride=4):out,name outputBuffer | ||
RWStructuredBuffer<int> outputBuffer; | ||
|
||
interface IFoo | ||
{ | ||
int getVal(); | ||
}; | ||
|
||
interface IBar | ||
{ | ||
[mutating] void method(out IFoo o); | ||
}; | ||
|
||
struct FooImpl : IFoo | ||
{ | ||
int x; | ||
int getVal() { return x; } | ||
} | ||
|
||
struct BarImpl : IBar | ||
{ | ||
void method(out IFoo o) | ||
{ | ||
o = FooImpl(1); | ||
} | ||
}; | ||
|
||
[numthreads(1,1,1)] | ||
void computeMain() | ||
{ | ||
BarImpl bar; | ||
IFoo foo; | ||
bar.method(foo); | ||
// CHK: 1 | ||
outputBuffer[0] = foo.getVal(); | ||
} |