-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Disallow ref structs in expression trees #30871
Disallow ref structs in expression trees #30871
Conversation
On the topic of parameters: Resolution: Allowed parameter and return types for delegates will not change. |
DiagnosticsPass_ExpressionTrees.cs seems like it might be a more appropriate location than this walker in the middle of lambda binding. |
src/Compilers/CSharp/Portable/FlowAnalysis/ExpressionTreeRefLikeWalker.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/FlowAnalysis/ExpressionTreeRefLikeWalker.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/FlowAnalysis/ExpressionTreeRefLikeWalker.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/FlowAnalysis/ExpressionTreeRefLikeWalker.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Outdated
Show resolved
Hide resolved
0ed7306
to
e04bc57
Compare
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.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.
Done with review pass (iteration 8)
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
Outdated
Show resolved
Hide resolved
Resolved feedback. Please have another look. |
src/Compilers/CSharp/Portable/Lowering/DiagnosticsPass_ExpressionTrees.cs
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
I forgot BoundTreeWalkerWithStackGuard prevents you from hooking VisitExpression so it can insert the stack guard.
@dotnet/roslyn-compiler please have a look |
This optimization is no longer valid. See dotnet/roslyn#30871
Resolves #30776
This adds the error code
ErrorCode.ERR_ExpressionTreeCantContainRefStruct
.