import foo {.all.} reboot (#17706)

This commit is contained in:
Timothee Cour 2021-04-16 00:16:39 -07:00 • committed by GitHub
commit 8161b02897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 584 additions and 76 deletions

23
tests/importalls/mt8.nim Normal file
View file

@ -0,0 +1,23 @@
#[
test multiple imports
]#
{.warning[UnusedImport]: off.}
import ./m1, m2 {.all.}, ./m3 {.all.}
# make sure this keeps using `import ./m1` without as.
# m1 is regularly imported
doAssert declared(m1.foo0)
doAssert declared(foo0)
doAssert not declared(m1.foo1)
# if we didn't call `createModuleAlias` even for `import f1 {.all.}`,
# this would fail, see D20201209T194412.
# m2
doAssert declared(m2.bar2)
doAssert declared(bar2)
# m3
doAssert declared(m3.m3h2)
doAssert declared(m3h2)