@@ -40,7 +40,7 @@ template asink*(t: PType): PSym = getAttachedOp(c.g, t, attachedSink)
40
40
41
41
proc fillBody(c: var TLiftCtx; t: PType; body, x, y: PNode)
42
42
proc produceSym(g: ModuleGraph; c: PContext; typ: PType; kind: TTypeAttachedOp;
43
- info: TLineInfo; idgen: IdGenerator; isDistinct = false ): PSym
43
+ info: TLineInfo; idgen: IdGenerator): PSym
44
44
45
45
proc createTypeBoundOps* (g: ModuleGraph; c: PContext; orig: PType; info: TLineInfo;
46
46
idgen: IdGenerator)
@@ -1063,9 +1063,7 @@ proc produceSymDistinctType(g: ModuleGraph; c: PContext; typ: PType;
1063
1063
assert typ.kind == tyDistinct
1064
1064
let baseType = typ.elementType
1065
1065
if getAttachedOp(g, baseType, kind) == nil :
1066
- # TODO : fixme `isDistinct` is a fix for #23552; remove it after
1067
- # `-d:nimPreviewNonVarDestructor` becomes the default
1068
- discard produceSym(g, c, baseType, kind, info, idgen, isDistinct = true )
1066
+ discard produceSym(g, c, baseType, kind, info, idgen)
1069
1067
result = getAttachedOp(g, baseType, kind)
1070
1068
setAttachedOp(g, idgen.module, typ, kind, result )
1071
1069
@@ -1104,7 +1102,7 @@ proc symDupPrototype(g: ModuleGraph; typ: PType; owner: PSym; kind: TTypeAttache
1104
1102
incl result .flags, sfGeneratedOp
1105
1103
1106
1104
proc symPrototype(g: ModuleGraph; typ: PType; owner: PSym; kind: TTypeAttachedOp;
1107
- info: TLineInfo; idgen: IdGenerator; isDiscriminant = false ; isDistinct = false ): PSym =
1105
+ info: TLineInfo; idgen: IdGenerator; isDiscriminant = false ): PSym =
1108
1106
if kind == attachedDup:
1109
1107
return symDupPrototype(g, typ, owner, kind, info, idgen)
1110
1108
@@ -1115,7 +1113,7 @@ proc symPrototype(g: ModuleGraph; typ: PType; owner: PSym; kind: TTypeAttachedOp
1115
1113
idgen, result , info)
1116
1114
1117
1115
if kind == attachedDestructor and g.config.selectedGC in {gcArc, gcOrc, gcAtomicArc} and
1118
- ((g.config.isDefined(" nimPreviewNonVarDestructor" ) and not isDiscriminant) or (typ.kind in {tyRef, tyString, tySequence} and not isDistinct )):
1116
+ ((g.config.isDefined(" nimPreviewNonVarDestructor" ) and not isDiscriminant) or (typ.kind in {tyRef, tyString, tySequence})):
1119
1117
dest.typ = typ
1120
1118
else :
1121
1119
dest.typ = makeVarType(typ.owner, typ, idgen)
@@ -1157,13 +1155,13 @@ proc genTypeFieldCopy(c: var TLiftCtx; t: PType; body, x, y: PNode) =
1157
1155
body.add newAsgnStmt(xx, yy)
1158
1156
1159
1157
proc produceSym(g: ModuleGraph; c: PContext; typ: PType; kind: TTypeAttachedOp;
1160
- info: TLineInfo; idgen: IdGenerator; isDistinct = false ): PSym =
1158
+ info: TLineInfo; idgen: IdGenerator): PSym =
1161
1159
if typ.kind == tyDistinct:
1162
1160
return produceSymDistinctType(g, c, typ, kind, info, idgen)
1163
1161
1164
1162
result = getAttachedOp(g, typ, kind)
1165
1163
if result == nil :
1166
- result = symPrototype(g, typ, typ.owner, kind, info, idgen, isDistinct = isDistinct )
1164
+ result = symPrototype(g, typ, typ.owner, kind, info, idgen)
1167
1165
1168
1166
var a = TLiftCtx(info: info, g: g, kind: kind, c: c, asgnForType: typ, idgen: idgen,
1169
1167
fn: result )
0 commit comments