-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve error message on generic value decls (#6169)
Co-authored-by: Yong He <yonghe@outlook.com>
- Loading branch information
1 parent
ac174d2
commit 92c9fff
Showing
5 changed files
with
47 additions
and
3 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
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
21 changes: 21 additions & 0 deletions
21
tests/diagnostics/generic-value-parameter-must-have-type.slang
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,21 @@ | ||
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -target spirv | ||
|
||
interface ITest | ||
{ | ||
static const uint kValue0; | ||
static const uint kValue1; | ||
}; | ||
|
||
// `TValue1` does not have an explicit type, this should fail to compile. | ||
// CHECK: error 30623: a generic value parameter | ||
// Make sure erroneous code is printed out. | ||
// CHECK: let TValue1> | ||
struct TestImpl<let TValue0 : uint, let TValue1> : ITest | ||
{ | ||
static const uint kValue0 = TValue0; | ||
static const uint kValue1 = TValue1; | ||
}; | ||
|
||
void computeMain() | ||
{ | ||
} |