dmd/compiler/test/fail_compilation/fail217.d
2023-11-16 16:10:34 +00:00

24 lines
442 B
D

/*
TEST_OUTPUT:
---
fail_compilation/fail217.d(22): Error: mutable constructor `fail217.Message.this` cannot construct a `immutable` object
fail_compilation/fail217.d(13): Consider adding `const` or `inout` here
---
*/
class Message
{
public int notifier;
this( int notifier_object )
{
notifier = notifier_object;
}
}
void
main()
{
auto m2 = new immutable(Message)(2);
m2.notifier = 3;
}