Closed Anton-4 closed 4 months ago
Strangely enough the signature okStr : Str -> Result Str [Hey]
does not result in a type mismatch.
I've got a possible fix in can/src/annotation.rs:
/*match ext {
Some(_) => {
// just `a` does not mean the same as `[]`, so even
// if there are no fields, still make this a `TagUnion`,
// not an EmptyTagUnion
Type::TagUnion(
Default::default(),
TypeExtension::from_type(ext_type, is_implicit_openness),
)
}
None => Type::EmptyTagUnion,
}*/
Type::TagUnion(
Default::default(),
TypeExtension::from_type(ext_type, is_implicit_openness),
)
I do now have a failing test tests/exhaustive/extend_uninhabited_without_opening_union.txt
, but I may just need to update it, going to talk it through with Folkert tomorrow.
If I remove my "unnecessary wildcard" my code does not work anymore :p
This produces the warning:
If I remove the
*
inokStr : Str -> Result Str []*
I get:It appears the
Result Str []
is not inferred asResult Str []*
, which would be the expected behavior.