@@ -234,6 +234,9 @@ proc mapReturnType(conf: ConfigRef; typ: PType): TCTypeKind =
234
234
proc isImportedType(t: PType): bool =
235
235
result = t.sym != nil and sfImportc in t.sym.flags
236
236
237
+ proc isNoDeclType(t: PType): bool =
238
+ result = t.sym != nil and lfNoDecl in t.sym.loc.flags
239
+
237
240
proc isImportedCppType(t: PType): bool =
238
241
let x = t.skipTypes(irrelevantForBackend)
239
242
result = (t.sym != nil and sfInfixCall in t.sym.flags) or
@@ -390,7 +393,7 @@ proc getTypeForward(m: BModule; typ: PType; sig: SigHash): Rope =
390
393
of tySequence, tyTuple, tyObject:
391
394
result = getTypeName(m, typ, sig)
392
395
m.forwTypeCache[sig] = result
393
- if not isImportedType (concrete):
396
+ if not isNoDeclType (concrete):
394
397
addForwardStructFormat(m, structOrUnion(typ), result )
395
398
else :
396
399
pushType(m, concrete)
@@ -1043,14 +1046,14 @@ proc getTypeDescAux(m: BModule; origTyp: PType, check: var IntSet; kind: TypeDes
1043
1046
if result == " " :
1044
1047
result = getTypeName(m, origTyp, sig)
1045
1048
m.forwTypeCache[sig] = result
1046
- if not isImportedType (t):
1049
+ if not isNoDeclType (t):
1047
1050
addForwardStructFormat(m, structOrUnion(t), result )
1048
1051
assert m.forwTypeCache[sig] == result
1049
1052
m.typeCache[sig] = result # always call for sideeffects:
1050
1053
if not incompleteType(t):
1051
1054
let recdesc = if t.kind != tyTuple: getRecordDesc(m, t, result , check)
1052
1055
else : getTupleDesc(m, t, result , check)
1053
- if not isImportedType(t):
1056
+ if not isImportedType(t) and not isNoDeclType(t) :
1054
1057
m.s[cfsTypes].add(recdesc)
1055
1058
elif tfIncompleteStruct notin t.flags:
1056
1059
discard # addAbiCheck(m, t, result) # already handled elsewhere
0 commit comments