Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message when importing modules indirectly #16271

Open
srackham opened this issue Oct 31, 2022 · 0 comments
Open

Incorrect error message when importing modules indirectly #16271

srackham opened this issue Oct 31, 2022 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@srackham
Copy link

V version: V 0.3.1 1b72125
OS: linux, Ubuntu 22.04.1 LTS (VM)

What did you do? Executed the following code:
bug.v (missing import m2)

import m1
m1.f(m2.Struct{})

m1/m1.v

module m1
import m2
pub fn f(s m2.Struct) {}

m2/m2.v

module m2
pub struct Struct {}

What did you expect to see?
A bug.v error message: error: unknown module 'm2'

What did you see instead?

$ v run bug.v
bug.v:2:15: error: unexpected token `{`, expecting `,`
    1 | import m1
    2 | m1.f(m2.Struct{})
      |               ^
@srackham srackham added the Bug This tag is applied to issues which reports bugs. label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant