Skip to content

Commit b305597

Browse files
committed
Enable getMessage on TypeError
I get it that `toMessage` will give a more precise error message. But that's no reason to hide the message obtained from `getMessage` completely.
1 parent ebb3b9a commit b305597

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeErrors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import config.Printers.cyclicErrors
1818
class TypeError(msg: String) extends Exception(msg) {
1919
def this() = this("")
2020
def toMessage(implicit ctx: Context): Message = super.getMessage
21-
override def getMessage: String = throw new Exception("Use toMessage instead for TypeError")
21+
override def getMessage: String = super.getMessage
2222
}
2323

2424
class MalformedType(pre: Type, denot: Denotation, absMembers: Set[Name]) extends TypeError {

0 commit comments

Comments
 (0)