builder: fix a bug with submodule import (#10318)

This commit is contained in:
Yuriy Zymlex 2021-06-05 19:45:23 +10:00 committed by GitHub
parent dc431a3c47
commit a716a00e38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,7 @@
import mymodules { add_xy }
import mymodules.submodule { sub_xy }
fn main() {
println(add_xy(2, 3)) // expected: 5
println(sub_xy(10, 7)) // expected: 3
}

View file

@ -0,0 +1,5 @@
module mymodule
pub fn add_xy(x int, y int) int {
return x + y
}

View file

@ -0,0 +1,5 @@
module submodule
pub fn sub_xy(x int, y int) int {
return x - y
}