File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -88,20 +88,21 @@ object handleRecursive {
88
88
89
89
class CyclicReference private (val denot : SymDenotation ) extends TypeError {
90
90
91
- def errorMsg (cx : Context ): Message =
92
- if (cx.mode is Mode .InferringReturnType ) {
93
- cx.tree match {
94
- case tree : untpd.DefDef if ! tree.tpt.typeOpt.exists =>
95
- OverloadedOrRecursiveMethodNeedsResultType (tree.name)
96
- case tree : untpd.ValDef if ! tree.tpt.typeOpt.exists =>
97
- RecursiveValueNeedsResultType (tree.name)
98
- case _ =>
99
- errorMsg(cx.outer)
91
+ override def toMessage (implicit ctx : Context ) = {
92
+
93
+ def errorMsg (cx : Context ): Message =
94
+ if (cx.mode is Mode .InferringReturnType ) {
95
+ cx.tree match {
96
+ case tree : untpd.DefDef if ! tree.tpt.typeOpt.exists =>
97
+ OverloadedOrRecursiveMethodNeedsResultType (tree.name)
98
+ case tree : untpd.ValDef if ! tree.tpt.typeOpt.exists =>
99
+ RecursiveValueNeedsResultType (tree.name)
100
+ case _ =>
101
+ errorMsg(cx.outer)
102
+ }
100
103
}
101
- }
102
- else CyclicReferenceInvolving (denot)
104
+ else CyclicReferenceInvolving (denot)
103
105
104
- override def toMessage (implicit ctx : Context ) = {
105
106
val cycleSym = denot.symbol
106
107
if (cycleSym.is(Implicit , butNot = Method ) && cycleSym.owner.isTerm)
107
108
CyclicReferenceInvolvingImplicit (cycleSym)
You can’t perform that action at this time.
0 commit comments