diff --git a/compiler/ast.nim b/compiler/ast.nim index cc3f4dcd99..a187687f4e 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -279,7 +279,7 @@ const GcTypeKinds* = {tyRef, tySequence, tyString} tyTypeClasses* = {tyBuiltInTypeClass, tyCompositeTypeClass, - tyUserTypeClass, tyUserTypeClassInst, + tyUserTypeClass, tyUserTypeClassInst, tyConcept, tyAnd, tyOr, tyNot, tyAnything} tyMetaTypes* = {tyGenericParam, tyTypeDesc, tyUntyped} + tyTypeClasses diff --git a/compiler/typeallowed.nim b/compiler/typeallowed.nim index 39193a42da..a814597e27 100644 --- a/compiler/typeallowed.nim +++ b/compiler/typeallowed.nim @@ -209,9 +209,6 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind, result = typeAllowedAux(marker, t.skipModifier, kind, c, flags+{taHeap}) else: result = t - of tyConcept: - if kind != skParam: result = t - else: result = nil proc typeAllowed*(t: PType, kind: TSymKind; c: PContext; flags: TTypeAllowedFlags = {}): PType = # returns 'nil' on success and otherwise the part of the type that is diff --git a/tests/concepts/tuninstantiated.nim b/tests/concepts/tuninstantiated.nim new file mode 100644 index 0000000000..2574cce25e --- /dev/null +++ b/tests/concepts/tuninstantiated.nim @@ -0,0 +1,17 @@ +block: # issue #24450 + type + B = object + b: int + A = object + x: int + AConcept = concept + proc implementation(s: var Self, p1: B) + + proc implementation(r: var A, p1: B)= + discard + + proc accept(r: var AConcept)= + discard + + var a = A() + a.accept()