summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-05-04 12:44:40 -0700
committerSom Snytt <som.snytt@gmail.com>2016-05-04 16:00:11 -0700
commit6379b70d952cf0eea96d205e14a291b441f9cd45 (patch)
tree5f26e590ef4a8dbd30519b8cf368b277a3c2bff8 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
parentf952a812340db7bc11f45b45f46e4b8ce7d6fb49 (diff)
downloadscala-6379b70d952cf0eea96d205e14a291b441f9cd45.tar.gz
scala-6379b70d952cf0eea96d205e14a291b441f9cd45.tar.bz2
scala-6379b70d952cf0eea96d205e14a291b441f9cd45.zip
SI-9045 Error on recursive ctor
If the constructor invokes itself, say so.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
index ccdff5c9a1..e190b57017 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
@@ -469,6 +469,11 @@ trait ContextErrors {
setError(tree)
}
+ def ConstructorRecursesError(tree: Tree) = {
+ issueNormalTypeError(tree, "constructor invokes itself")
+ setError(tree)
+ }
+
def OnlyDeclarationsError(tree: Tree) = {
issueNormalTypeError(tree, "only declarations allowed here")
setError(tree)