-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:union-typesIssues tied to union types.Issues tied to union types.better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancementprio:low
Description
Compiler version
3.4.2
Minimized example
type Union = Int | Int
Output Error/Warning message
No warning
Suggested improvement
-- [E006] Union Duplicate Warning: ----------------
1 | Int | Int
| ^^ ^^
| `Int` declared twice in union, consider removing one occurence
1 warning found
I'm not sure if this is actionable as there may be cases where it'd be desirable, with generics for example
type IntOr[T] = Int | T
but at least for concrete types I think it'd be a good warning to declutter the code (mostly an issue with long unions, and/or type alias)
Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcarea:union-typesIssues tied to union types.Issues tied to union types.better-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancementprio:low