summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semstmts.nim22
-rw-r--r--testament/important_packages.nim3
-rw-r--r--tests/macros/tastrepr.nim5
-rw-r--r--tests/macros/tgetimpl.nim4
4 files changed, 5 insertions, 29 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 5a0968ba5..a0eda36d1 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1259,9 +1259,6 @@ proc typeSectionTypeName(c: PContext; n: PNode): PNode =
     result = n[0]
   else:
     result = n
-  if result.kind == nkPostfix:
-    if result.len != 2: illFormedAst(n, c.config)
-    result = result[1]
   if result.kind != nkSym: illFormedAst(n, c.config)
 
 proc typeDefLeftSidePass(c: PContext, typeSection: PNode, i: int) =
@@ -1329,15 +1326,9 @@ proc typeDefLeftSidePass(c: PContext, typeSection: PNode, i: int) =
     elif s.owner == nil: s.owner = getCurrOwner(c)
 
   if name.kind == nkPragmaExpr:
-    if name[0].kind == nkPostfix:
-      typeDef[0][0][1] = newSymNode(s)
-    else:
-      typeDef[0][0] = newSymNode(s)
+    typeDef[0][0] = newSymNode(s)
   else:
-    if name.kind == nkPostfix:
-      typeDef[0][1] = newSymNode(s)
-    else:
-      typeDef[0] = newSymNode(s)
+    typeDef[0] = newSymNode(s)
 
 proc typeSectionLeftSidePass(c: PContext, n: PNode) =
   # process the symbols on the left side for the whole type section, before
@@ -1547,15 +1538,8 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
       of nkSym: obj.ast[0] = symNode
       of nkPragmaExpr:
         obj.ast[0] = a[0].shallowCopy
-        if a[0][0].kind == nkPostfix:
-          obj.ast[0][0] = a[0][0].shallowCopy
-          obj.ast[0][0][1] = symNode
-        else:
-          obj.ast[0][0] = symNode
+        obj.ast[0][0] = symNode
         obj.ast[0][1] = a[0][1]
-      of nkPostfix:
-        obj.ast[0] = a[0].shallowCopy
-        obj.ast[0][1] = symNode
       else: assert(false)
       obj.ast[1] = a[1]
       obj.ast[2] = a[2][0]
diff --git a/testament/important_packages.nim b/testament/important_packages.nim
index d056dac69..d3d3f0643 100644
--- a/testament/important_packages.nim
+++ b/testament/important_packages.nim
@@ -97,8 +97,7 @@ pkg "memo"
 pkg "msgpack4nim", "nim c -r tests/test_spec.nim"
 pkg "nake", "nim c nakefile.nim"
 pkg "neo", "nim c -d:blas=openblas --mm:refc tests/all.nim", url = "https://github.com/nim-lang/neo"
-pkg "nesm", "nimble tests", "https://github.com/nim-lang/NESM", useHead = true, allowFailure = true
-  # inactive, tests not adapted to #23096
+pkg "nesm", "nimble tests", "https://github.com/nim-lang/NESM", useHead = true
 pkg "netty"
 pkg "nico", allowFailure = true
 pkg "nicy", "nim c -r src/nicy.nim"
diff --git a/tests/macros/tastrepr.nim b/tests/macros/tastrepr.nim
index 668904cae..c04498a25 100644
--- a/tests/macros/tastrepr.nim
+++ b/tests/macros/tastrepr.nim
@@ -11,8 +11,6 @@ for i, (x, y) in pairs(data):
 var
   a = 1
   b = 2
-type
-  A* = object
 
 var data = @[(1, "one"), (2, "two")]
 for (i, d) in pairs(data):
@@ -22,8 +20,6 @@ for i, d in pairs(data):
 for i, (x, y) in pairs(data):
   discard
 var (a, b) = (1, 2)
-type
-  A* = object
 '''
 """
 
@@ -48,4 +44,3 @@ echoTypedAndUntypedRepr:
   for i, (x,y) in pairs(data):
     discard
   var (a,b) = (1,2)
-  type A* = object # issue #22933
diff --git a/tests/macros/tgetimpl.nim b/tests/macros/tgetimpl.nim
index e215d2696..398957672 100644
--- a/tests/macros/tgetimpl.nim
+++ b/tests/macros/tgetimpl.nim
@@ -75,9 +75,7 @@ assert: check_gen_proc(len(a)) == (false, true)
 macro check(x: type): untyped =
   let z = getType(x)
   let y = getImpl(z[1])  
-  var sym = y[0]
-  if sym.kind == nnkPragmaExpr: sym = sym[0]
-  if sym.kind == nnkPostfix: sym = sym[1]
+  let sym = if y[0].kind == nnkSym: y[0] else: y[0][0]
   expectKind(z[1], nnkSym)
   expectKind(sym, nnkSym)
   expectKind(y[2], nnkObjectTy)