Re: Compiler Error CS0702
- From: PIEBALD <PIEBALD@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 18 Apr 2008 11:43:00 -0700
Enum and delegate could indeed be useful. (In particular, I'd like to
write a generic version of Enum.Parse to avoid the casts.)
Yes, and I can only guess that support of them was left out because they
don't buy as much as class and struct do. But I see no reason why they
_can't_ be supported by an implementation. So I see no reason for the spec to
disallow them.
If, when generics were first added to the language, the spec had said that
they _are_ to be supported then they _would_ be supported. The argument that
the spec says they _aren't_ because the current implementation doesn't
support them is backward. A _language_ exists separate from any particular
_implementation_.
We can use enums as type parameters, I see no reason not to be allowed to
constrain to them. It's not as if they weren't allowed in generics at all.
I'm looking for a _conceptual_ reason why they aren't, not an
implementation-based reason and so far have seen none.
If one regards _only_ the language, not considering .net, the CLR, CTS etc.;
is there some reason why enum and delegate should _not_ be supported as
constraints?
.
- Follow-Ups:
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: Jon Skeet [C# MVP]
- Re: Compiler Error CS0702
- References:
- Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Peter Duniho
- Re: Compiler Error CS0702
- From: PIEBALD
- Re: Compiler Error CS0702
- From: Jon Skeet [C# MVP]
- Compiler Error CS0702
- Prev by Date: Re: How change application setting in class library project programmatically?
- Next by Date: Re: EventArgs
- Previous by thread: Re: Compiler Error CS0702
- Next by thread: Re: Compiler Error CS0702
- Index(es):
Relevant Pages
|
Loading