-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Labels
type: clarityWhile not technically incorrect, the Standard is potentially confusingWhile not technically incorrect, the Standard is potentially confusing
Milestone
Description
See #757 (comment)
Original comment on section 11.2.1
I think we may want an example here to clarify this. I believe I get it, but it could be confusing.
For example, consider:
if (x is string s)It's fine for the compile-time type of
x
to beobject
, even though a value whose execution type isobject
won't match. But the expression type beingobject
is okay because the value might be astring
reference. Whereas if the compile-time type ofx
is (say)Stream
then this would be a compile-time error.
Note that in #934 I added the clarifying change from "it is an error" to "it is a compile-time error" referenced in the same conversation.
The additional example is deferred to after C# 7
Metadata
Metadata
Assignees
Labels
type: clarityWhile not technically incorrect, the Standard is potentially confusingWhile not technically incorrect, the Standard is potentially confusing