Skip to content

Commit f55f7d3

Browse files
committed
ccgtypes: ignore sink modifier for RTTI creation
Since `sink` now contributes to the sighash of types, `sink int` and `int` would produce get two separate RTTI objects, which is wrong.
1 parent 4568745 commit f55f7d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/backend/ccgtypes.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ proc genTypeInfoV2Impl(m: BModule, t, origType: PType, name: Rope; info: TLineIn
11161116
discard genTypeInfoV1(m, t, info)
11171117

11181118
proc genTypeInfoV2(m: BModule, t: PType; info: TLineInfo): Rope =
1119-
let origType = t
1119+
let origType = skipTypes(t, {tySink})
11201120
# distinct types can have their own destructors
11211121
var t = skipTypes(origType, irrelevantForBackend + tyUserTypeClasses - {tyDistinct})
11221122

@@ -1188,7 +1188,7 @@ proc typeToC(t: PType): string =
11881188
result.addInt ord(c)
11891189

11901190
proc genTypeInfoV1(m: BModule, t: PType; info: TLineInfo): Rope =
1191-
let origType = t
1191+
let origType = skipTypes(t, {tySink})
11921192
var t = skipTypes(origType, irrelevantForBackend + tyUserTypeClasses)
11931193

11941194
let prefixTI = "(&"

0 commit comments

Comments
 (0)