diff options
author | Adam Trousdale <adam.trousdale@sky.com> | 2016-12-21 20:12:56 +0000 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-12-21 21:12:56 +0100 |
commit | ee4f4a109b3ec3190886c75bb6d140087c33287d (patch) | |
tree | 704d89e1c3f3465afee76178c746382e22235512 /compiler/src/dotty/tools/dotc/reporting/diagnostic | |
parent | f3bf225c241fcf0db8f71585e15161f2cda9bd59 (diff) | |
download | dotty-ee4f4a109b3ec3190886c75bb6d140087c33287d.tar.gz dotty-ee4f4a109b3ec3190886c75bb6d140087c33287d.tar.bz2 dotty-ee4f4a109b3ec3190886c75bb6d140087c33287d.zip |
Add error messages - Parsers.scala:712 (#1842)
* Add error messages - Parsers.scala:712
* Tidy up imports and formatting
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting/diagnostic')
-rw-r--r-- | compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala index 9dda233bf..b55b7e868 100644 --- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala @@ -5,8 +5,7 @@ package diagnostic import dotc.core._ import Contexts.Context, Decorators._, Symbols._, Names._, NameOps._, Types._ -import util.{SourceFile, NoSource} -import util.{SourcePosition, NoSourcePosition} +import util.SourcePosition import config.Settings.Setting import interfaces.Diagnostic.{ERROR, WARNING, INFO} import printing.Highlighting._ @@ -901,4 +900,27 @@ object messages { val msg = hl"trying to define package with same name as `$existing`" val explanation = "" } + + case class ExistentialTypesNoLongerSupported()(implicit ctx: Context) extends Message(34) { + val kind = "Syntax" + val msg = + hl"""|Existential types are no longer supported - + |use a wildcard or dependent type instead""" + val explanation = + hl"""|The use of existential types is no longer supported. + | + |You should use a wildcard or dependent type instead. + | + |For example: + | + |Instead of using ${"forSome"} to specify a type variable + | + |${"List[T forSome { type T }]"} + | + |Try using a wildcard type variable + | + |${"List[_]"} + |""" + } + } |