You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compile as a library with /langversion:preview /nullable:enable /features:updated-memory-safety-rules and .NET 11 reference assemblies.
Compiler 5.12.0-1.26463.105 succeeds. Compiler 5.12.0-1.26471.108 stack-overflows; the latter succeeds without the feature flag.
The recursive stack goes through SourceMemberContainerTypeSymbol.AddSynthesizedTypeMembersIfNecessary, Binder.BindType, and Binder.ReportDiagnosticsIfUnsafeMemberAccess / checkTypeArgumentWithConstructorConstraint, which accesses InstanceConstructors while union members are being synthesized.
Repro:
Compile as a library with
/langversion:preview /nullable:enable /features:updated-memory-safety-rulesand .NET 11 reference assemblies.Compiler
5.12.0-1.26463.105succeeds. Compiler5.12.0-1.26471.108stack-overflows; the latter succeeds without the feature flag.The recursive stack goes through
SourceMemberContainerTypeSymbol.AddSynthesizedTypeMembersIfNecessary,Binder.BindType, andBinder.ReportDiagnosticsIfUnsafeMemberAccess/checkTypeArgumentWithConstructorConstraint, which accessesInstanceConstructorswhile union members are being synthesized.This blocks dotnet/runtime#134394. CI build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1609539. The constraint-check changes in #84888 appear relevant. The same failure reproduces locally on macOS arm64 compiling System.Text.Json.Tests.
Expected: Successful compilation without disabling updated memory-safety checks.
Note
This issue was generated by GitHub Copilot.