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

29
tests/ic/timports.nim Normal file
View file

@ -0,0 +1,29 @@
import mimports
doAssert fn1() == 1
doAssert not declared(hfn3)
#!EDIT!#
import mimports {.all.}
doAssert fn1() == 1
doAssert declared(hfn3)
doAssert hfn3() == 3
doAssert mimports.hfn4() == 4
# reexports
doAssert not declared(fnb1)
doAssert not declared(hfnb4)
doAssert fnb2() == 2
doAssert hfnb3() == 3
#!EDIT!#
from mimports {.all.} import hfn3
doAssert not declared(fn1)
from mimports {.all.} as bar import fn1
doAssert fn1() == 1
doAssert hfn3() == 3
doAssert not declared(hfn4)
doAssert declared(mimports.hfn4)
doAssert mimports.hfn4() == 4
doAssert bar.hfn4() == 4