Skip to content

Commit

Permalink
Extra help for -Vcyclic
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Apr 4, 2024
1 parent f18a699 commit 6781f7a
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -852,9 +852,11 @@ trait TypeDiagnostics extends splain.SplainDiagnostics {
else if (organics.length == 1) organics(0)
else organics.find(_.pos.focus == pos.focus).getOrElse(organics(0))
}
def help = if (!badsym.isSynthetic || settings.cyclic.value) "" else
s"; $badsym is synthetic; use -Vcyclic to find which definition needs an explicit type"
condOpt(tree) {
case ValDef(_, _, TypeTree(), _) => s"recursive $badsym needs type"
case DefDef(_, _, _, _, TypeTree(), _) => s"${cyclicAdjective(badsym)} $badsym needs result type"
case ValDef(_, _, TypeTree(), _) => s"recursive $badsym needs type$help"
case DefDef(_, _, _, _, TypeTree(), _) => s"${cyclicAdjective(badsym)} $badsym needs result type$help"
case Import(_, _) =>
sm"""encountered unrecoverable cycle resolving import.
|Note: this is often due in part to a class depending on a definition nested within its companion.
Expand Down

0 comments on commit 6781f7a

Please sign in to comment.