Dotty Documentation


abstract class Message
extends Object

A Message contains all semantic information necessary to easily comprehend what caused the message to be logged. Each message can be turned into a MessageContainer which contains the log level and can later be consumed by a subclass of Reporter. However, the error position is only part of MessageContainer, not Message.

NOTE: you should not be persisting Most messages take an implicit Context and these contexts weigh in at about 4mb per instance, as such persisting these will result in a memory leak.

Instead use the persist method to create an instance that does not keep a reference to these contexts.

[-] Constructors

Message ( errorId: ErrorMessageID )

[-] Members

[+] val errorId : ErrorMessageID
[+] def append ( suffix: => String ) : Message
[+] def explanation : String

The explanation should provide a detailed description of why the error occurred and use examples from the user's own code to illustrate how to avoid these errors.

[+] def kind : String

The kind of the error message is something like "Syntax" or "Type Mismatch"

[+] def msg : String

The msg contains the diagnostic message e.g:

expected: String found: Int

This message will be placed underneath the position given by the enclosing MessageContainer

[+] def persist : Message

The implicit Context in messages is a large thing that we don't want persisted. This method gets around that by duplicating the message without the implicit context being passed along.