IS4
IS4
> readonly interface members would be great for structs - but what would that mean for implementing classes (there we have no readonly methods, too)? I have said that already...
@jaredpar Frankly I still don't see any compatibility issue here. The meaning of `readonly` is fixed for structs and their methods ‒ externally it signalizes that the method won't change...
@jaredpar What exactly does it mean that "this proposal ignores `class`"? Both in the initial post and in my two previous posts I have given an example how this could...
So why or how *should* a class take `readonly` on an interface into account? Interfaces don't have any fields or inner workings that even could be protected with `readonly`.
> So potentially to respect that, a class might have to not mutate itself in any of tehse members. How is that useful to users of the interface? I cannot...
> There are many times i would like to enforce that a type isn't mutating out from underneath me, and having such a constraint would be valuable, even for classes....
Why not this? ``` return """ // lang = cs class Foo { } """; ``` A single-line comment would fit after `"""`, after all. Having a Markdown-style identifier there...
`where T : ref struct` looks kinda weird. It would feel strange and a bit lengthy to use `where T : ref struct, struct` in constraints.
Why should `where T : ref struct` imply `struct`? If this is an "anti-constraint" it should give you an option to use *all* types, classes and ref structs together, and...
But why have such a limitation? There is nothing `struct`s cannot do that `ref struct`s can, it's all just a matter of what the actual generic type/method is allowed to...