Getting an 'Invalid typeref' error from swift-reflection-dump

I built swift-reflection-dump using swift-6.0.3-RELEASE to dump a SwiftUICore binary, but I'm getting an 'Invalid typeref' error from output. How can I resolve this?

 /Volumes/Untitled/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64/bin/swift-reflection-dump --arch=arm64 /Library/Developer/CoreSimulator/Volumes/iOS_22C150/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 18.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore > ./SwiftUICore.txt
__C.CGVector
------------
dx:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
dy:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
__C.CGAffineTransform
---------------------
a:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
b:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
c:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
d:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
tx:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡
 - TypeDecoder.h:1499: Node kind 221 "u¡
" - unexpected kind
ty:  with unmangled suffix "\x02u\xC1\r\0"
!!! Invalid typeref: u¡

@Kyle-Ye Any idea about this? Thanks.

Looks like you are encountering an error when decoding the CGAffineTransform and CGVector's property type

And TypeDecoder does not handle the 221 case here.

I'm not familiar with the logic too. Maybe you can try to add another case logic here to just ignore the 221 Node kind (Seems to be SpecializationPassID)?

1 Like

Also what is the corresponding SDK's SwiftUICore you are trying to dump? iOS 18.0 Beta X or iOS 18.X?

I am trying with iOS 18.2 Simulator.

Thanks. It seems that TypeDecoder.decodeMangledType doesn't handle all node types. This error occurs because NodeKind::Suffix is not handled. I'll look into it.

1 Like