dotnet/roslyn
CSharpObjectFormatter throws NotSupportedException if it reaches ref struct property.
開放
#51,548 建立於 2021年2月28日
Area-InteractiveBugInteractive-ScriptingLogichelp wanted
倉庫指標
- 星標
- (20,414 顆星)
- PR 合併指標
- (平均合併 6天 17小時) (30 天內合併 256 個 PR)
描述
Version Used: Microsoft.CodeAnalysis.CSharp.Scripting 3.8.0 and 3.9.0-5.final (I tested both)
Steps to Reproduce:
ref struct X {};
class Y { public X x => default; };
CSharpObjectFormatter.Instance.FormatObject(new Y()); // dies
Expected Behavior:
CSharpObjectFormatter to ignore properties that are ref structs.
Actual Behavior:
CSharpObjectFormatter tries to fetch the value of the ref struct property with reflection, which throws because reflection does not support ref structs.