diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-05-04 12:44:40 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-05-04 16:00:11 -0700 |
commit | 6379b70d952cf0eea96d205e14a291b441f9cd45 (patch) | |
tree | 5f26e590ef4a8dbd30519b8cf368b277a3c2bff8 /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | f952a812340db7bc11f45b45f46e4b8ce7d6fb49 (diff) | |
download | scala-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.scala | 5 |
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) |