-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce a concept of internal special types, move all members defined in special types to the SpecialMember set. #72646
Conversation
…ed in special types to the SpecialMember set. Closes dotnet#72102. Closes dotnet#72280.
@dotnet/roslyn-compiler Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small comments. Overall this looks good.
|
||
public override string ToString() | ||
{ | ||
return _value.ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether it would be useful, for debugging purposes, to instead have ToString
determine whether _value
is a special type or an internal special type, then call ToString
on the appropriate value, so we get the right string representation. I think I'd at least like a DebuggerDisplay
with that logic. #Pending
Co-authored-by: Fred Silberberg <fred@silberberg.xyz>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked with Aleksey about following up on the ToString change separately.
@dotnet/roslyn-compiler For the second review. |
public static explicit operator ExtendedSpecialType(int value) => new ExtendedSpecialType(value); | ||
public static explicit operator int(ExtendedSpecialType value) => value._value; | ||
|
||
public static bool operator ==(ExtendedSpecialType left, SpecialType right) => left._value == (byte)right; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need multiple ==
/!=
operators? The (ExtendedSpecialType, ExtendedSpecialType)
flavor should be sufficient given the SpecialType -> ExtendedSpecialType
implicit conversion. #Closed
src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
Outdated
Show resolved
Hide resolved
src/Compilers/VisualBasic/Portable/Lowering/SyntheticBoundNodeFactory.vb
Show resolved
Hide resolved
src/Compilers/VisualBasic/Portable/Lowering/SyntheticBoundNodeFactory.vb
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with review pass (iteration 2)
src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 3)
src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
Outdated
Show resolved
Hide resolved
I am going to add this symbol to the Refers to: src/Compilers/VisualBasic/Portable/CodeGen/EmitExpression.vb:2230 in 6eda453. [](commit_id = 6eda453, deletion_comment = False) |
Closes #72102.
Closes #72280.