hash-org / hashc

The Hash programming language compiler :zap:
https://hash-org.github.io/hashc/
MIT License
26 stars 2 forks source link

Module resolution fails to lookup imported symbol #980

Closed feds01 closed 5 months ago

feds01 commented 1 year ago

The following snippet:

fmt := import("printing");

main := () => {
    y := 1 + 1 + 1 + 1;
    fmt::print_int(y + t);
}

print_int is a defined function in the printing stdlib module: https://github.com/hash-org/hashc/blob/1c6e3790b62ae19d2f32ebbb6760d1df855d524c/stdlib/printing.hash#L20

Instead, the symbol lookup fails:

error[0010]: cannot find member `print_int` in `printing`
 --> ~/examples/main.hash:5:5
4 |       y := 1 + 1 + 1 + 1;
5 |       fmt::print_int(y + t);
  |       ^^^^^^^^^^^^^^ tried to look for member `print_int` in `printing`
6 |   }