diff --git a/compiler/astdef.nim b/compiler/astdef.nim index b9a8aab3e1..242cdf3ef6 100644 --- a/compiler/astdef.nim +++ b/compiler/astdef.nim @@ -202,7 +202,11 @@ type tySequence, tyProc, tyPointer, tyOpenArray, - tyString, tyCstring, tyForward, + tyString, tyCstring, + tyForward, + # a type not yet semchecked + # When semcheck a type section, all types defined in it are initialized to tyForward + tyInt, tyInt8, tyInt16, tyInt32, tyInt64, # signed integers tyFloat, tyFloat32, tyFloat64, tyFloat128, tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64, diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 1a4bd24965..94435886a9 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -1739,6 +1739,7 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = var isConcrete = true let rType = m.call[0].typ let mIndex = if rType != nil: rType.len - 1 else: -1 + var hasForwardTypeParam = false for i in 1..