diff --git a/crates/compiler/can/src/annotation.rs b/crates/compiler/can/src/annotation.rs index bd817c21ce..2118faf72f 100644 --- a/crates/compiler/can/src/annotation.rs +++ b/crates/compiler/can/src/annotation.rs @@ -968,19 +968,10 @@ fn can_annotation_help( ); if tags.is_empty() { - 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), + ) } else { let mut tag_types = can_tags( env, @@ -1173,6 +1164,7 @@ fn can_extension_type( local_aliases, references, ); + if valid_extension_type(shallow_dealias_with_scope(scope, &ext_type)) { if matches!(loc_ann.extract_spaces().item, TypeAnnotation::Wildcard) && matches!(ext_problem_kind, ExtensionTypeKind::TagUnion) diff --git a/crates/compiler/uitest/tests/exhaustive/extend_uninhabited_without_opening_union.txt b/crates/compiler/uitest/tests/exhaustive/extend_uninhabited_without_opening_union.txt index 30d9fb105c..f9d66d559d 100644 --- a/crates/compiler/uitest/tests/exhaustive/extend_uninhabited_without_opening_union.txt +++ b/crates/compiler/uitest/tests/exhaustive/extend_uninhabited_without_opening_union.txt @@ -3,5 +3,5 @@ app "test" provides [main] to "./platform" walkHelp : {} -> [Continue {}, Break []] main = when walkHelp {} is -# ^^^^^^^^^^^ [Break [], Continue {}] +# ^^^^^^^^^^^ [Break []w_a, Continue {}] Continue {} -> {}