-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3784 : add an enum for Error kind #3785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
4c372e7
3a16862
cf24c76
f624ef9
7b933f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package dotty.tools.dotc.reporting.diagnostic | ||
|
||
sealed case class ErrorCategory(name: String) { | ||
override def toString: String = name | ||
} | ||
object ErrorCategories { | ||
val COMPATIBILITY = ErrorCategory("Compatibility") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use Scala naming convention: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can definitely rename everything, but it unfortunately clashes with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes you can disambiguate with |
||
val DEFINITION_NOT_FOUND = ErrorCategory("Definition Not Found") | ||
val DUPLICATE_SYMBOL = ErrorCategory("Duplicate Symbol") | ||
val MATCH_CASE_UNREACHABLE = ErrorCategory("Match case Unreachable") | ||
val MEMBER_NOT_FOUND = ErrorCategory("Member Not Found") | ||
val NAMING = ErrorCategory("Naming") | ||
val NO_KIND = ErrorCategory("") | ||
val PATTERN_MATCH_EXHAUSTIVITY = ErrorCategory("Pattern Match Exhaustivity") | ||
val REFERENCE = ErrorCategory("Reference") | ||
val SYNTAX = ErrorCategory("Syntax") | ||
val TYPE_MISMATCH = ErrorCategory("Type Mismatch") | ||
val UNBOUND_IDENTIFIER = ErrorCategory("Unbound Identifier") | ||
val USAGE = ErrorCategory("Usage") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you intend to make it behave like an enum, I suggest you use this pattern: