File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/generators/Silk.NET.SilkTouch.Symbols Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ protected virtual TypeReference VisitTypeReference(TypeReference typeReference)
118
118
{
119
119
if ( typeReference is ExternalTypeReference etr ) return VisitExternalTypeReference ( etr ) ;
120
120
if ( typeReference is InternalTypeReference itr ) return VisitInternalTypeReference ( itr ) ;
121
- if ( typeReference is UnresolvedTypeReference utr ) UnresolvedTypeReference . ThrowInvalidSymbol ( ) ;
121
+ if ( typeReference is UnresolvedTypeReference utr ) UnresolvedTypeReference . ThrowInvalidSymbol ( utr ) ;
122
122
if ( typeReference is PointerTypeReference ptr ) return VisitPointerTypeReference ( ptr ) ;
123
123
if ( typeReference is FunctionPointerTypeReference fptr ) return VisitFunctionPointerTypeReference ( fptr ) ;
124
124
return ThrowUnknownSymbol < TypeReference > ( typeReference ) ;
Original file line number Diff line number Diff line change @@ -14,9 +14,12 @@ public sealed record UnresolvedTypeReference(string Text) : TypeReference
14
14
/// Throw helper to use when encountering <see cref="UnresolvedTypeReference"/> when type resolution should've already happened.
15
15
/// </summary>
16
16
/// <exception cref="InvalidOperationException"></exception>
17
- public static void ThrowInvalidSymbol ( )
17
+ public static void ThrowInvalidSymbol ( UnresolvedTypeReference utr )
18
18
{
19
+ // This is by far the most common exception during generation, so make sure it's useful!!
19
20
throw new InvalidOperationException
20
- ( $ "Visited { nameof ( UnresolvedTypeReference ) } , but type resolution should have already happened.") ;
21
+ (
22
+ $ "Visited { nameof ( UnresolvedTypeReference ) } , but type resolution should have already happened. Text: \" { utr . Text } \" "
23
+ ) ;
21
24
}
22
25
}
You can’t perform that action at this time.
0 commit comments