mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
21 lines
367 B
D
21 lines
367 B
D
// https://issues.dlang.org/show_bug.cgi?id=22686
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/test22686.d(15): Error: `this` is only defined in non-static member functions, not `create`
|
|
---
|
|
*/
|
|
|
|
struct S
|
|
{
|
|
int[] data;
|
|
static auto create()
|
|
{
|
|
auto self = &this;
|
|
return {
|
|
assert(data.length);
|
|
return self;
|
|
};
|
|
}
|
|
}
|