Skip to content

Funky Generic Thing #30

@uberFoo

Description

@uberFoo

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions