-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comThe issue was originally reported on https://developercommunity.visualstudio.comFeature - RecordsRecordsRecordsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented
Milestone
Description
Version Used:
Visual-Studio-2019-Version-16.8
Visual-Studio-2019-Version-16.9-Preview-1
🔗 Also filed as AB#1246298
Steps to Reproduce:
Compile this snippet under .NET 5 / C# 9:
using System;
public interface IFoo
{
event EventHandler Event;
}
public record Foo : IFoo
{
event EventHandler IFoo.Event { add { } remove { } }
event EventHandler Event { add { } remove { } }
}Expected Behavior:
It should compile (the same way as class does).
Actual Behavior:
C:\Program Files\dotnet\sdk\5.0.100\Roslyn\Microsoft.CSharp.Core.targets(71,5): error : Stack overflow. [c:\Projects\Triage\Net5.CSharp9\Net5.CSharp9.csproj]
I'm not sure where's the entry point, but it loops like this:
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventSymbol.ComputeIsWindowsRuntimeEvent()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventSymbol.get_IsWindowsRuntimeEvent()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventAccessorSymbol.MethodChecks(Microsoft.CodeAnalysis.DiagnosticBag)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberMethodSymbol.LazyMethodChecks()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventAccessorSymbol.get_Parameters()
at Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.get_ParameterCount()
at Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions.GetParameterCount(Microsoft.CodeAnalysis.CSharp.Symbol)
at Microsoft.CodeAnalysis.CSharp.Symbols.MemberSignatureComparer.GetHashCode(Microsoft.CodeAnalysis.CSharp.Symbol)
at System.Collections.Generic.Dictionary`2[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FindValue(System.__Canon)
at System.Collections.Generic.Dictionary`2[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ContainsKey(System.__Canon)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.AddSynthesizedRecordMembersIfNecessary(MembersAndInitializersBuilder, Microsoft.CodeAnalysis.DiagnosticBag)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.BuildMembersAndInitializers(Microsoft.CodeAnalysis.DiagnosticBag)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersAndInitializers()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.MakeAllMembers(Microsoft.CodeAnalysis.DiagnosticBag)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersByNameSlow()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersByName()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetMembersUnordered()
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.MakeExplicitInterfaceImplementationMap()
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.GetExplicitImplementationForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol)
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol, Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol, Microsoft.CodeAnalysis.DiagnosticBag, Boolean, Boolean ByRef)
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationAndDiagnosticsForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol, Boolean, Boolean ByRef)
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.FindImplementationForInterfaceMemberInNonInterfaceWithDiagnostics(Microsoft.CodeAnalysis.CSharp.Symbol, Boolean)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventSymbol.ComputeIsWindowsRuntimeEvent()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventSymbol.get_IsWindowsRuntimeEvent()
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceEventAccessorSymbol.MethodChecks(Microsoft.CodeAnalysis.DiagnosticBag)
Side effects:
Just opening this file in a Visual Studio causes the crash. The file doesn't have to be part of any project. No error is displayed due to StackOverflow nature.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comThe issue was originally reported on https://developercommunity.visualstudio.comFeature - RecordsRecordsRecordsResolution-FixedThe bug has been fixed and/or the requested behavior has been implementedThe bug has been fixed and/or the requested behavior has been implemented