mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

Fix Issue 24206 - Can't alias a function type that returns a type with a TypeSuffix Add isTypeSuffix() function. This also means a function type with a TypeCtor is now deprecated, just like a function pointer type with a TypeCtor. This gives a better error message and simplifies the code.
15 lines
921 B
D
15 lines
921 B
D
/+ TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail21243.d(12): Error: found `(` when expecting `ref` and function literal following `auto`
|
|
fail_compilation/fail21243.d(12): Error: semicolon expected following auto declaration, not `int`
|
|
fail_compilation/fail21243.d(12): Error: semicolon needed to end declaration of `x` instead of `)`
|
|
fail_compilation/fail21243.d(12): Error: declaration expected, not `)`
|
|
fail_compilation/fail21243.d(13): Error: `auto` can only be used as part of `auto ref` for function literal return values
|
|
fail_compilation/fail21243.d(14): Error: `auto` can only be used as part of `auto ref` for function literal return values
|
|
fail_compilation/fail21243.d(15): Error: `auto` can only be used as part of `auto ref` for function literal return values
|
|
---
|
|
+/
|
|
auto a = auto (int x) => x;
|
|
auto b = function auto (int x) { return x; };
|
|
alias c = auto (int x) => x;
|
|
alias d = function auto (int x) { return x; };
|