Properties

monkyyy crazymonkyyy at gmail.com
Thu Jul 18 23:40:39 UTC 2024


On Thursday, 18 July 2024 at 20:31:31 UTC, Quirin Schroll wrote:
> very new syntax

?

What if @property enforced that (when used), the length of the 
overload set is >2

```d

int foo()=>3;
void bar(int){};

alias foobar @property =foo;
alias foobar=bar;

unittest{
   int a=foo;//finds that foobar is an overload set with length 2,
   bar=a;
}
```

```d
struct foo{
   @property int bar()=>3;
   void bar()(){ static assert(0);}
}
unittest{
   foo f;
   int=f.bar;//fails, while it detects bar(2), it fails some test
}
```


More information about the dip.ideas mailing list