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

Generic argument types should not be compatible with each other #1062

Closed
degory opened this issue Feb 15, 2024 · 0 comments · Fixed by #1064
Closed

Generic argument types should not be compatible with each other #1062

degory opened this issue Feb 15, 2024 · 0 comments · Fixed by #1064
Labels

Comments

@degory
Copy link
Owner

degory commented Feb 15, 2024

The following should result in compile time type errors

do_something[T,U](t: T, u: U) -> T is
    let tt: T = u; // should error T is not assignable from U

    return u; // should error T is not assignable from U    
si
@degory degory converted this from a draft issue Feb 15, 2024
@degory degory added the bug label Feb 15, 2024
degory added a commit that referenced this issue Feb 15, 2024
Bugs fixed:
- Fix issue where null was wrongly treated as assignment compatible with value types (closes Null should not be assignment compatible with value types #1061)
- Fix issue where different generic type arguments were sometimes wrongly treated as assignment compatible with each other (closes #1062)
- Fix issue where null was wrongly treated as assignment compatible with generic type arguments (closes #1063)

Technical:
- Remove workarounds for recently fixed anonymous function argument type inference issue
- Add integration tests asserting generic type arguments are compatible with object
- Make error messages for failed type inference consistent with each other
@degory degory closed this as completed in 58d106f Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant