dmd/compiler/test/fail_compilation/test19107.d
Dennis a3abf1187e
Fix 23722 - Lambdas are mangled incorrectly when using multiple compi… (#15343)
* Fix 23722 - Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code

* Update test cases
2024-11-27 12:03:16 +01:00

25 lines
622 B
D

/*
EXTRA_FILES: imports/imp19661.d imports/test19107a.d imports/test19107b.d
TEST_OUTPUT:
---
fail_compilation/test19107.d(24): Error: template `all` is not callable using argument types `!((c) => c)(string[])`
fail_compilation/test19107.d(18): Candidate is: `all(alias pred, T)(T t)`
with `pred = __lambda_L24_C15,
T = string[]`
must satisfy the following constraint:
` is(typeof(I!pred(t)))`
---
*/
// https://issues.dlang.org/show_bug.cgi?id=19107
import imports.test19107b;
void all(alias pred, T)(T t)
if (is(typeof(I!pred(t))))
{ }
void main(string[] args)
{
args.all!(c => c);
}