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

Fully Qualified Names are not allowed in type signatures #8997

Open
radeusgd opened this issue Feb 7, 2024 · 0 comments
Open

Fully Qualified Names are not allowed in type signatures #8997

radeusgd opened this issue Feb 7, 2024 · 0 comments
Assignees
Labels
--bug Type: bug -compiler -type-system Category: type system and type inference

Comments

@radeusgd
Copy link
Member

radeusgd commented Feb 7, 2024

Repro:

from Standard.Base import all

foo : Standard.Base.Data.Numbers.Integer
foo = 1

bar (x : Standard.Base.Data.Numbers.Integer) = 10+x

main =
    bar foo

This seems like a completely valid program, but it fails to compile with:

X:\NBO\repr\test3.enso:3:7: error: The name `Standard.Base.Data.Numbers.Integer` could not be found.
    3 | foo : Standard.Base.Data.Numbers.Integer
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X:\NBO\repr\test3.enso:6:10: error: The name `Standard.Base.Data.Numbers.Integer` could not be found.
    6 | bar (x : Standard.Base.Data.Numbers.Integer) = 10+x
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Aborting due to 2 errors and 0 warnings.
Execution finished with an error: Compilation aborted due to errors.

If I replace the FQNs with just Integer it runs all fine.

I don't see any reason why FQNs should not be allowed in type signatures. In fact it is rather confusing.

Note that the exact same FQN used as value works all fine:

from Standard.Base import all

main =
    IO.println Standard.Base.Data.Numbers.Integer
    IO.println (42.is_a Standard.Base.Data.Numbers.Integer)

printing

Integer
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -compiler -type-system Category: type system and type inference
Projects
Status: 📤 Backlog
Development

No branches or pull requests

3 participants