From 1868cbc44959e04f0455f062793f53426b0ebdf7 Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 19 Jul 2019 19:32:13 +0200 Subject: [PATCH] revert the bugfix for #11747 as it really was a new, poorly though-out feature --- compiler/semexprs.nim | 3 --- tests/metatype/ttypedesc3.nim | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 929283bef9..733df2c404 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1414,9 +1414,6 @@ proc semDeref(c: PContext, n: PNode): PNode = var t = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyLent, tyAlias, tySink, tyOwned}) case t.kind of tyRef, tyPtr: n.typ = t.lastSon - of tyTypeDesc: - # typeof(x[]) is still a typedesc: - n.typ = makeTypeDesc(c, t.lastSon.lastSon) else: result = nil #GlobalError(n.sons[0].info, errCircumNeedsPointer) diff --git a/tests/metatype/ttypedesc3.nim b/tests/metatype/ttypedesc3.nim index a906905919..ff6e22718d 100644 --- a/tests/metatype/ttypedesc3.nim +++ b/tests/metatype/ttypedesc3.nim @@ -40,4 +40,4 @@ type MyRefType = ref MyType -echo sizeof(MyRefType[]) +echo sizeof(default(MyRefType)[])