diff --git a/compiler/importer.nim b/compiler/importer.nim index 39a447b709..54489ada4e 100644 --- a/compiler/importer.nim +++ b/compiler/importer.nim @@ -250,7 +250,7 @@ proc importModuleAs(c: PContext; n: PNode, realModule: PSym, importHidden: bool) result.options.incl optImportHidden c.unusedImports.add((result, n.info)) c.importModuleMap[result.id] = realModule.id - c.importModuleLookup.mgetOrPut(realModule.name.id, @[]).addUnique realModule.id + c.importModuleLookup.mgetOrPut(result.name.id, @[]).addUnique realModule.id proc transformImportAs(c: PContext; n: PNode): tuple[node: PNode, importHidden: bool] = var ret: typeof(result) diff --git a/parse/pragmas.nim b/parse/pragmas.nim new file mode 100644 index 0000000000..bf77a28420 --- /dev/null +++ b/parse/pragmas.nim @@ -0,0 +1,3 @@ +# parse/pragmas.nim content + +proc foo*() = discard \ No newline at end of file diff --git a/tests/import/buzz/m21496.nim b/tests/import/buzz/m21496.nim index 7c87e2c04a..677324000b 100644 --- a/tests/import/buzz/m21496.nim +++ b/tests/import/buzz/m21496.nim @@ -1 +1 @@ -proc fb* = echo "buzz!" \ No newline at end of file +proc fb*: string = "buzz!" \ No newline at end of file diff --git a/tests/import/fizz/m21496.nim b/tests/import/fizz/m21496.nim index 834c11eae0..525b653d66 100644 --- a/tests/import/fizz/m21496.nim +++ b/tests/import/fizz/m21496.nim @@ -1 +1 @@ -proc fb* = echo "fizz!" \ No newline at end of file +proc fb*: string = "fizz!" \ No newline at end of file diff --git a/tests/import/t21496.nim b/tests/import/t21496.nim index b49d830b0e..1a4907b123 100644 --- a/tests/import/t21496.nim +++ b/tests/import/t21496.nim @@ -6,4 +6,4 @@ import fizz/m21496, buzz/m21496 # bug #21496 -m21496.fb() +discard m21496.fb() diff --git a/tests/import/t22208.nim b/tests/import/t22208.nim new file mode 100644 index 0000000000..b935d751cb --- /dev/null +++ b/tests/import/t22208.nim @@ -0,0 +1,6 @@ +import fizz/m21496 as alas +import buzz/m21496 + +# bug #21496 + +doAssert m21496.fb() == "buzz!"