I've just fixed UFCS for the experimental type function branch

jmh530 john.michael.hall at gmail.com
Thu Sep 10 19:31:13 UTC 2020

On Thursday, 10 September 2020 at 18:05:23 UTC, Paul Backus wrote:
> [snip]
> One thing built-in .sizeof does that no user-code version can 
> do is "freeze" the size of a type to prevent additional members 
> from being added. For example, if you try to compile this code:
> struct S
> {
>     int a;
>     enum size = S.sizeof;
>     mixin("int b;");
> }
> ...you'll get an error:
> onlineapp.d-mixin-5(5): Error: variable onlineapp.S.b cannot be 
> further field because it will change the determined S size

I wouldn't want to rely on something like that personally. I'd 
rather guarantee that the only members are those in a specific 

More information about the Digitalmars-d mailing list