summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semtypes.nim5
-rw-r--r--tests/macros/tnimnode_for_runtime.nim12
2 files changed, 5 insertions, 12 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index ec4cea131..b633c87ab 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1050,7 +1050,12 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
           result.flags.incl tfIterator
           # XXX Would be nice if we could get rid of this
       result.sons[0] = r
+      let oldFlags = result.flags
       propagateToOwner(result, r)
+      if oldFlags != result.flags:
+        # XXX This rather hacky way keeps 'tflatmap' compiling:
+        if tfHasMeta notin oldFlags:
+          result.flags.excl tfHasMeta
       result.n.typ = r
 
   if genericParams != nil and genericParams.len > 0:
diff --git a/tests/macros/tnimnode_for_runtime.nim b/tests/macros/tnimnode_for_runtime.nim
deleted file mode 100644
index 0520cd0dd..000000000
--- a/tests/macros/tnimnode_for_runtime.nim
+++ /dev/null
@@ -1,12 +0,0 @@
-discard """
-  output: "bla"
-"""
-
-import macros
-proc makeMacro: NimNode =
-  result = nil
-
-var p = makeMacro()
-
-echo "bla"
-