//compiles fine
"test" match {
case a:String => "b"
case sd => "default"
}
//does not compile
"test" match
case a:String => "b"
case sd => "default"
/**
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked",
"-explain-cyclic",
"-Ydebug-cyclic",
)
**/
Recursive value $t needs type
The error occurred while trying to compute the signature of value $t
which required to type the right hand side of value $t since no explicit type was given
which required to compute the signature of value $t
Stacktrace:
dotty.tools.dotc.core.CyclicReference$.apply(TypeErrors.scala:208)
dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:172)
dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
dotty.tools.dotc.core.Types$Type.widen(Types.scala:1269)
dotty.tools.dotc.typer.Typer.simplify(Typer.scala:3218)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3209)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3392)
dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1219)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3134)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3207)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3392)
dotty.tools.dotc.typer.Typer.caseRest$1(Typer.scala:1933)
dotty.tools.dotc.typer.Typer.typedCase(Typer.scala:1953)
dotty.tools.dotc.typer.Typer.typedCases$$anonfun$1(Typer.scala:1876)
dotty.tools.dotc.core.Decorators$.loop$1(Decorators.scala:94)
dotty.tools.dotc.core.Decorators$.mapconserve(Decorators.scala:110)
dotty.tools.dotc.typer.Typer.typedCases(Typer.scala:1875)
dotty.tools.dotc.typer.Typer.$anonfun$34(Typer.scala:1866)
dotty.tools.dotc.typer.Applications.harmonic(Applications.scala:2419)
dotty.tools.dotc.typer.Applications.harmonic$(Applications.scala:380)
dotty.tools.dotc.typer.Typer.harmonic(Typer.scala:116)
dotty.tools.dotc.typer.Typer.typedMatchFinish(Typer.scala:1866)
dotty.tools.dotc.typer.Typer.typedMatch(Typer.scala:1798)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3140)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3207)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3392)
dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1704)
dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1694)
dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1704)
dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1958)
dotty.tools.dotc.inlines.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:242)
dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1958)
dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1966)
dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1984)
dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1985)
dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1996)
dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1742)
dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1749)
dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:801)
dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:954)
dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:828)
dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:174)
dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:392)
dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3067)
dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3092)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3206)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3303)
dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3349)
dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1212)
dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1216)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3134)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3207)
dotty.tools.dotc.typer.ProtoTypes$FunProto.$anonfun$7(ProtoTypes.scala:500)
dotty.tools.dotc.typer.ProtoTypes$FunProto.cacheTypedArg(ProtoTypes.scala:423)
dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:501)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:931)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:931)
dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:617)
dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:685)
dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:520)
dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:811)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:930)
dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1192)
dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:380)
dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:116)
dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:1003)
dotty.tools.dotc.typer.Applications.realApply$1$$anonfun$2(Applications.scala:1113)
dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:3416)
dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1128)
dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1166)
dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:380)
dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:116)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3126)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3207)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3330)
dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3349)
dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2746)
dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3114)
dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3118)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3206)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3303)
dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3349)
dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2889)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3159)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3207)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3277)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:3281)
dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3392)
dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:45)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:463)
dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:51)
dotty.tools.dotc.typer.TyperPhase.$anonfun$4(TyperPhase.scala:97)
scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
scala.collection.immutable.List.prependedAll(List.scala:152)
scala.collection.immutable.List$.from(List.scala:685)
scala.collection.immutable.List$.from(List.scala:682)
scala.collection.IterableOps$WithFilter.map(Iterable.scala:900)
dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:96)
dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:315)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
dotty.tools.dotc.Run.runPhases$1(Run.scala:308)
dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:349)
dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:358)
dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
dotty.tools.dotc.Run.compileUnits(Run.scala:358)
dotty.tools.dotc.Run.compileSources(Run.scala:261)
dotty.tools.dotc.Run.compile(Run.scala:246)
dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:141)
dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:196)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:252)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:186)
sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:166)
sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:241)
sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:166)
sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:214)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:542)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:542)
sbt.internal.inc.Incremental$.$anonfun$apply$3(Incremental.scala:182)
sbt.internal.inc.Incremental$.$anonfun$apply$3$adapted(Incremental.scala:180)
sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:458)
sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:117)
sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:413)
sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:500)
sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:400)
sbt.internal.inc.Incremental$.apply(Incremental.scala:208)
sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:542)
sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:496)
sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:433)
sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2443)
sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2393)
sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:41)
sbt.internal.io.Retry$.apply(Retry.scala:47)
sbt.internal.io.Retry$.apply(Retry.scala:29)
sbt.internal.io.Retry$.apply(Retry.scala:24)
sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:41)
sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2391)
scala.Function1.$anonfun$compose$1(Function1.scala:49)
sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
sbt.std.Transform$$anon$4.work(Transform.scala:69)
sbt.Execute.$anonfun$submit$2(Execute.scala:283)
sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
sbt.Execute.work(Execute.scala:292)
sbt.Execute.$anonfun$submit$1(Execute.scala:283)
sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.lang.Thread.run(Thread.java:840)