4 ms·
Correct me if I'm wrong here, but those things have to be done at the CLR level anyway. Otherwise the compiler couldn't warn about wrong usage of method declara
by ygra 11y ago
Correct me if I'm wrong here, but those things have to be done at the CLR level anyway. Otherwise the compiler couldn't warn about wrong usage of method declarations in external libraries (as one example in the proposal shows). For that to work the types or parameters would need to be atributed in some way in the IL. And then it's not only a C# compiler feature anymore.
- wvenable 11y agoThe CLR already supports arbitrary attributes on methods and parameters. So one could implement this entirely in the language and still target old versions of the CLR.
- MichaelGG 11y agoThey can smuggle it in via attributes. But if they don't make this part of the CLR spec, then not really cross-platform and more like C#'s extension methods. Ideally these features would be designed at a higher level, in the CLR, aimed to target as many languages as possible. I.e., they shouldn't be proposed as C# extensions.