summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semgnrc.nim4
-rw-r--r--tests/generics/mmodule_same_as_proc.nim2
-rw-r--r--tests/generics/tmodule_same_as_proc.nim9
3 files changed, 13 insertions, 2 deletions
diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim
index 205af36a8..e3b598919 100644
--- a/compiler/semgnrc.nim
+++ b/compiler/semgnrc.nim
@@ -57,7 +57,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym,
   of skUnknown:
     # Introduced in this pass! Leave it as an identifier.
     result = n
-  of skProc, skMethod, skIterators, skConverter:
+  of skProc, skMethod, skIterators, skConverter, skModule:
     result = symChoice(c, n, s, scOpen)
   of skTemplate:
     if macroToExpand(s):
@@ -225,7 +225,7 @@ proc semGenericStmt(c: PContext, n: PNode,
       of skUnknown, skParam:
         # Leave it as an identifier.
         discard
-      of skProc, skMethod, skIterators, skConverter:
+      of skProc, skMethod, skIterators, skConverter, skModule:
         result.sons[0] = symChoice(c, fn, s, scOption)
         first = 1
       of skGenericParam:
diff --git a/tests/generics/mmodule_same_as_proc.nim b/tests/generics/mmodule_same_as_proc.nim
new file mode 100644
index 000000000..048b98336
--- /dev/null
+++ b/tests/generics/mmodule_same_as_proc.nim
@@ -0,0 +1,2 @@
+
+proc mmodule_same_as_proc*(x: string) = discard
diff --git a/tests/generics/tmodule_same_as_proc.nim b/tests/generics/tmodule_same_as_proc.nim
new file mode 100644
index 000000000..113ca1bc3
--- /dev/null
+++ b/tests/generics/tmodule_same_as_proc.nim
@@ -0,0 +1,9 @@
+
+# bug #1965
+
+import mmodule_same_as_proc
+
+proc test[T](t: T) =
+  mmodule_same_as_proc"a"
+
+test(0)