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

lent T causes error when used as generic parameter #1458

Open
alaviss opened this issue Sep 10, 2024 · 0 comments
Open

lent T causes error when used as generic parameter #1458

alaviss opened this issue Sep 10, 2024 · 0 comments
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler

Comments

@alaviss
Copy link
Contributor

alaviss commented Sep 10, 2024

Example

{.experimental: "views".}
type O[T] = object

O[lent int]()

Actual Output

test.nim(4, 8) Error: type mismatch: got 'typedesc[int]' for 'int' but expected 'lent'

Expected Output

No error

Additional Information

  • If an indirection via type Lint = lent int and Option[Lint] is done, nothing bad will happen.
@alaviss alaviss added bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler/sem Related to semantic-analysis system of the compiler
Projects
None yet
Development

No branches or pull requests

1 participant