dmd/compiler/test/fail_compilation/fnconstraint.d
Nick Treleaven 46b38993db
Improve expected } error after aggregate members (#15528)
* Use errorSupplemental for expected `}` following members error

* Tweak declaration start message
2023-08-12 10:58:35 +02:00

26 lines
675 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fnconstraint.d(14): Error: template constraint must follow parameter lists and attributes
fail_compilation/fnconstraint.d(14): Error: declaration expected, not `if`
fail_compilation/fnconstraint.d(23): Error: template constraint must follow parameter lists and attributes
fail_compilation/fnconstraint.d(23): Error: declaration expected, not `if`
fail_compilation/fnconstraint.d(27): Error: `}` expected following members in `struct` declaration
fail_compilation/fnconstraint.d(19): struct `S` starts here
---
*/
void foo()()
in(true)
if (true)
{}
alias f = foo!();
struct S
{
this()()
if (true)
if (true) {}
}
S s;