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

Compiler: Re-exporting types causes types not to match #1759

Closed
spotandjake opened this issue Mar 18, 2023 · 1 comment
Closed

Compiler: Re-exporting types causes types not to match #1759

spotandjake opened this issue Mar 18, 2023 · 1 comment

Comments

@spotandjake
Copy link
Member

test.gr

module Main

include "./test1"

from Test1 use *
print(A)
print(Test1.runTest() == A)

test1.gr

module Test1

include "./test2"

from Test2 use { type Test }

provide { type Test }
provide let runTest = Test2.runTest

test2.gr

/* grainc-flags --no-pervasives */
module Test2

provide enum Test {
  A,
  B,
  C,
}

provide let runTest = () => A

When you run this it gives the error shown in the image below
image
It loosk as though when you re-export the type it belongs to the module you are re-exporting from where as the intial type belongs to the module the function it exists in and they no longer match.

@spotandjake
Copy link
Member Author

This is a duplicate of #1758

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

1 participant