-
-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #20763 - Inconsistent handling of type + value in typeof expressions
- Loading branch information
Dennis Korpel
committed
Jan 28, 2025
1 parent
84c7b04
commit 6a8bdda
Showing
2 changed files
with
32 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
REQUIRED_ARGS: -de | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation\test20763.d(19): Deprecation: type `ulong` has no value | ||
fail_compilation\test20763.d(20): Deprecation: type `ulong` has no value | ||
fail_compilation\test20763.d(21): Error: type `ulong` has no value | ||
fail_compilation\test20763.d(22): Error: type `ulong` has no value | ||
fail_compilation\test20763.d(23): Error: type `ulong` has no value | ||
fail_compilation\test20763.d(24): Error: type `ulong` has no value | ||
--- | ||
*/ | ||
|
||
// https://github.com/dlang/dmd/issues/20763 | ||
void test() | ||
{ | ||
alias I = ulong; | ||
alias U0 = typeof(I + 1u); | ||
alias U1 = typeof(1 - I); | ||
alias U2 = typeof(+I); | ||
alias U3 = typeof(I * 1); | ||
alias U4 = typeof(I << 1); | ||
alias U5 = typeof(I | 1); | ||
} |