diff --git a/ast/src/constrain.rs b/ast/src/constrain.rs index 5bfc97131f..561da5c644 100644 --- a/ast/src/constrain.rs +++ b/ast/src/constrain.rs @@ -2209,18 +2209,6 @@ pub mod test_constrain { ) } - #[test] - fn constrain_private_tag() { - infer_eq( - indoc!( - r#" - @Foo - "# - ), - "[ @Foo ]*", - ) - } - #[test] fn constrain_call_and_accessor() { infer_eq( diff --git a/compiler/parse/src/ident.rs b/compiler/parse/src/ident.rs index c7e917ec4d..e871563d9e 100644 --- a/compiler/parse/src/ident.rs +++ b/compiler/parse/src/ident.rs @@ -223,7 +223,6 @@ pub enum BadIdent { WeirdDotAccess(Position), WeirdDotQualified(Position), StrayDot(Position), - BadPrivateTag(Position), BadOpaqueRef(Position), } diff --git a/reporting/src/error/canonicalize.rs b/reporting/src/error/canonicalize.rs index 9d755bee9c..eadcd1e07b 100644 --- a/reporting/src/error/canonicalize.rs +++ b/reporting/src/error/canonicalize.rs @@ -925,13 +925,10 @@ fn to_bad_ident_expr_report<'b>( ]) } - BadPrivateTag(pos) | BadOpaqueRef(pos) => { + BadOpaqueRef(pos) => { use BadIdentNext::*; - let kind = if matches!(bad_ident, BadPrivateTag(..)) { - "a private tag" - } else { - "an opaque reference" - }; + let kind = "an opaque reference"; + match what_is_next(alloc.src_lines, lines.convert_pos(pos)) { LowercaseAccess(width) => { let region = Region::new(pos, pos.bump_column(width)); @@ -983,7 +980,7 @@ fn to_bad_ident_expr_report<'b>( alloc.reflow(r"But after the "), alloc.keyword("@"), alloc.reflow(r" symbol I found a lowercase letter. "), - alloc.reflow(r"All tag names (global and private)"), + alloc.reflow(r"All opaque references "), alloc.reflow(r" must start with an uppercase letter, like "), alloc.parser_suggestion("@UUID"), alloc.reflow(" or "), diff --git a/reporting/src/error/parse.rs b/reporting/src/error/parse.rs index b03c5d0826..922ef4cf38 100644 --- a/reporting/src/error/parse.rs +++ b/reporting/src/error/parse.rs @@ -38,17 +38,6 @@ fn hint_for_tag_name<'a>(alloc: &'a RocDocAllocator<'a>) -> RocDocBuilder<'a> { ]) } -fn hint_for_private_tag_name<'a>(alloc: &'a RocDocAllocator<'a>) -> RocDocBuilder<'a> { - alloc.concat([ - alloc.hint("Private tag names "), - alloc.reflow("start with an `@` symbol followed by an uppercase letter, like "), - alloc.parser_suggestion("@UID"), - alloc.text(" or "), - alloc.parser_suggestion("@SecretKey"), - alloc.text("."), - ]) -} - fn record_patterns_look_like<'a>(alloc: &'a RocDocAllocator<'a>) -> RocDocBuilder<'a> { alloc.concat([ alloc.reflow(r"Record pattern look like "), @@ -2475,23 +2464,6 @@ fn to_ttag_union_report<'a>( severity: Severity::RuntimeError, } } - Next::Other(Some('@')) => { - let doc = alloc.stack([ - alloc.reflow( - r"I am partway through parsing a tag union type, but I got stuck here:", - ), - alloc.region_with_subregion(lines.convert_region(surroundings), region), - alloc.reflow(r"I was expecting to see a private tag name."), - hint_for_private_tag_name(alloc), - ]); - - Report { - filename, - doc, - title: "WEIRD TAG NAME".to_string(), - severity: Severity::RuntimeError, - } - } _ => { let doc = alloc.stack([ alloc.reflow(r"I am partway through parsing a tag union type, but I got stuck here:"),