提交 d3bd40c8 编写于 作者: H Heejae Chang

Merge pull request #8561 from heejaechang/formatsymbol2

address more PR feedback.
......@@ -126,19 +126,5 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Public Shared Function DefaultErrorFormat(symbol As Symbol) As FormattedSymbol
Return New FormattedSymbol(symbol, SymbolDisplayFormat.VisualBasicErrorMessageFormat)
End Function
Public Shared Function DefaultErrorFormatIfSpecialType(arg As Object) As Object
Dim symbol = TryCast(arg, Symbol)
If symbol Is Nothing Then
Return arg
End If
If TypeOf symbol Is TypeSymbol AndAlso DirectCast(symbol, TypeSymbol).SpecialType <> SpecialType.None Then
Return DefaultErrorFormat(symbol)
End If
Return symbol
End Function
End Class
End Namespace
......@@ -50,7 +50,8 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Symbols
Dim containingAssembly As AssemblySymbol = Me.ContainingAssembly
If containingAssembly.IsMissing Then
Return ErrorFactory.ErrorInfo(ERRID.ERR_UnreferencedAssembly3, containingAssembly.Identity, CustomSymbolDisplayFormatter.DefaultErrorFormatIfSpecialType(Me))
Dim arg = If(Me.SpecialType <> SpecialType.None, DirectCast(CustomSymbolDisplayFormatter.DefaultErrorFormat(Me), Object), Me)
Return ErrorFactory.ErrorInfo(ERRID.ERR_UnreferencedAssembly3, containingAssembly.Identity, arg)
Else
Dim containingModule As ModuleSymbol = Me.ContainingModule
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册