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

type mismatch error with pass through import/export with intermediate module also defining symbol #23497

Open
tersec opened this issue Apr 12, 2024 · 1 comment

Comments

@tersec
Copy link
Contributor

tersec commented Apr 12, 2024

Description

a.nim:

import "."/b
type H = b.E
discard H(default(F))

b.nim:

import "."/c
export c
type
  E* = object
  F* = b.E

c.nim:

type E* = object

And try to nim c a.

Nim Version

Nim Compiler Version 1.6.20 [Linux: amd64]
Compiled at 2024-04-12
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 19fdbfc173bfccb64cb64e0a963e69f52f71fc73
active boot switches: -d:release
Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-04-12
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: b47747d31844c6bd9af4322efe55e24fefea544c
active boot switches: -d:release
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-04-12
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 1bd095521856d4d1f9fb1b6ba580df3c815196f6
active boot switches: -d:release

Current Output

/root/a.nim(3, 10) Error: type mismatch:
 got 'E' for 'default(F)' [object declared in /root/b.nim(5, 3)]
 but expected 'E = Alias' [object declared in /root/c.nim(1, 6)]

Expected Output

Successful build

Possible Solution

No response

Additional Information

No response

@metagn
Copy link
Collaborator

metagn commented Apr 13, 2024

So the problem is that H is c.E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants