blob: 02c6b242c595dd773e1e74b51bd5b1bac2121c34 [file] [log] [blame]
/*
TEST_OUTPUT:
---
fail_compilation/fail302.d(21): Error: cannot implicitly convert expression `1` of type `int` to `Bar`
---
*/
struct Bar
{
uint num;
Bar opAssign(uint otherNum)
{
num = otherNum;
return this;
}
}
void main()
{
Bar bar = 1; // disallow because construction is not assignment
auto x = bar.num;
}