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

Funky Generic Thing #30

Open
uberFoo opened this issue Mar 5, 2024 · 0 comments
Open

Funky Generic Thing #30

uberFoo opened this issue Mar 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@uberFoo
Copy link
Owner

uberFoo commented Mar 5, 2024

This code does not work:

let a = Result::<int, string>::Ok(42);
a.is_ok()

It craps out because in is_ok it's doing a match, and it fails to match at all. If the generics weren't there it would work fine.

This works, and I'm not sure why:

let a = Result::Ok(42);
let b = Result::Ok("test");
a.is_ok() && b.is_ok()

How are we distinguishing between the different Results? There is no visible type information there, and if there had been it would fail.

So generics are certainly not done.

@uberFoo uberFoo added bug Something isn't working documentation Improvements or additions to documentation labels Mar 5, 2024
@uberFoo uberFoo self-assigned this Mar 5, 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 documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant