Open
Description
Compiler version
Current main
@ 1b5138d
Minimized code
Example 1:
import language.experimental.captureChecking
import caps.*
trait Collection[+T] extends Mutable:
update def add(elem: T): Unit
update def remove(elem: T): Unit
def get(index: Int): Option[T]
Example 2:
trait Collection[T] extends Mutable // <- note the forgotten :
update def add(elem: T): Unit
update def remove(elem: T): Unit
def get(index: Int): Option[T]
Output (click arrow to expand)
Trace of example 1:
at dotty.tools.dotc.parsing.Parsers$Parser.modOfToken(Parsers.scala:3294)
at dotty.tools.dotc.parsing.Parsers$Parser.addModifier(Parsers.scala:3312)
at dotty.tools.dotc.parsing.Parsers$Parser.loop$1(Parsers.scala:3374)
at dotty.tools.dotc.parsing.Parsers$Parser.modifiers(Parsers.scala:3382)
at dotty.tools.dotc.parsing.Parsers$Parser.defAnnotsMods(Parsers.scala:3417)
at dotty.tools.dotc.parsing.Parsers$Parser.localDef(Parsers.scala:4740)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq$$anonfun$1(Parsers.scala:4780)
at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:550)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq(Parsers.scala:4786)
at dotty.tools.dotc.printing.SyntaxHighlighting$.highlight(SyntaxHighlighting.scala:127)
at dotty.tools.dotc.reporting.MessageRendering.sourceLines(MessageRendering.scala:66)
at dotty.tools.dotc.reporting.MessageRendering.messageAndPos(MessageRendering.scala:251)
at dotty.tools.dotc.reporting.MessageRendering.messageAndPos$(MessageRendering.scala:20)
at dotty.tools.dotc.reporting.AbstractReporter.messageAndPos(AbstractReporter.scala:8)
at dotty.tools.dotc.reporting.ConsoleReporter$AbstractConsoleReporter.doReport(ConsoleReporter.scala:43)
at dotty.tools.dotc.reporting.ConsoleReporter.doReport(ConsoleReporter.scala:23)
at dotty.tools.dotc.reporting.Reporter.issueUnconfigured(Reporter.scala:160)
at dotty.tools.dotc.reporting.Reporter.go$1(Reporter.scala:191)
at dotty.tools.dotc.reporting.Reporter.issueIfNotSuppressed(Reporter.scala:210)
at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:213)
at dotty.tools.dotc.report$.error(report.scala:69)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.checkVariance(VarianceChecker.scala:191)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.traverse(VarianceChecker.scala:212)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.traverse$$anonfun$2$$anonfun$1(VarianceChecker.scala:215)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:334)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.traverse$$anonfun$2(VarianceChecker.scala:215)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:334)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.traverse(VarianceChecker.scala:215)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1807)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1807)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.fold$1(Trees.scala:1671)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply(Trees.scala:1673)
at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1766)
at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1808)
at dotty.tools.dotc.typer.VarianceChecker$Traverser$.traverse(VarianceChecker.scala:208)
at dotty.tools.dotc.typer.VarianceChecker$.check(VarianceChecker.scala:25)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:517)
at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.loop$2(tpd.scala:1301)
at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1301)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transformStats(PostTyper.scala:633)
at dotty.tools.dotc.ast.tpd$TreeMapWithPreciseStatContexts.transformStats(tpd.scala:1303)
at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1622)
at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:42)
at dotty.tools.dotc.transform.PostTyper$PostTyperTransformer.transform(PostTyper.scala:623)
at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:20)
at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:383)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:334)
at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:376)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:368)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1324)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:361)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$2(Run.scala:408)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$adapted$1(Run.scala:408)
at scala.Function0.apply$mcV$sp(Function0.scala:42)
at dotty.tools.dotc.Run.showProgress(Run.scala:470)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:408)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:420)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
at dotty.tools.dotc.Run.compileUnits(Run.scala:420)
at dotty.tools.dotc.Run.compileSources(Run.scala:307)
at dotty.tools.dotc.Run.compile(Run.scala:292)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
at dotty.tools.dotc.Driver.process(Driver.scala:201)
at dotty.tools.dotc.Driver.process(Driver.scala:169)
at dotty.tools.dotc.Driver.process(Driver.scala:181)
at dotty.tools.dotc.Driver.main(Driver.scala:211)
at dotty.tools.dotc.Main.main(Main.scala)
Trace for example 2:
at dotty.tools.dotc.parsing.Parsers$Parser.modOfToken(Parsers.scala:3294)
at dotty.tools.dotc.parsing.Parsers$Parser.addModifier(Parsers.scala:3312)
at dotty.tools.dotc.parsing.Parsers$Parser.loop$1(Parsers.scala:3374)
at dotty.tools.dotc.parsing.Parsers$Parser.modifiers(Parsers.scala:3382)
at dotty.tools.dotc.parsing.Parsers$Parser.defAnnotsMods(Parsers.scala:3417)
at dotty.tools.dotc.parsing.Parsers$Parser.localDef(Parsers.scala:4740)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq$$anonfun$1(Parsers.scala:4780)
at dotty.tools.dotc.parsing.Parsers$Parser.checkNoEscapingPlaceholders(Parsers.scala:550)
at dotty.tools.dotc.parsing.Parsers$Parser.blockStatSeq(Parsers.scala:4786)
at dotty.tools.dotc.printing.SyntaxHighlighting$.highlight(SyntaxHighlighting.scala:127)
at dotty.tools.dotc.reporting.MessageRendering.sourceLines(MessageRendering.scala:66)
at dotty.tools.dotc.reporting.MessageRendering.messageAndPos(MessageRendering.scala:251)
at dotty.tools.dotc.reporting.MessageRendering.messageAndPos$(MessageRendering.scala:20)
at dotty.tools.dotc.reporting.AbstractReporter.messageAndPos(AbstractReporter.scala:8)
at dotty.tools.dotc.reporting.ConsoleReporter$AbstractConsoleReporter.doReport(ConsoleReporter.scala:43)
at dotty.tools.dotc.reporting.ConsoleReporter.doReport(ConsoleReporter.scala:23)
at dotty.tools.dotc.reporting.Reporter.issueUnconfigured(Reporter.scala:160)
at dotty.tools.dotc.reporting.Reporter.go$1(Reporter.scala:191)
at dotty.tools.dotc.reporting.Reporter.issueIfNotSuppressed(Reporter.scala:210)
at dotty.tools.dotc.reporting.Reporter.report(Reporter.scala:213)
at dotty.tools.dotc.report$.error(report.scala:69)
at dotty.tools.dotc.typer.ErrorReporting$.errorType(ErrorReporting.scala:32)
at dotty.tools.dotc.typer.ErrorReporting$.errorTree(ErrorReporting.scala:23)
at dotty.tools.dotc.typer.ErrorReporting$.errorTree(ErrorReporting.scala:26)
at dotty.tools.dotc.typer.Typer.typedIdent(Typer.scala:722)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3620)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3733)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3811)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3816)
at dotty.tools.dotc.typer.Typer.typedType(Typer.scala:3930)
at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1796)
at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1789)
at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1796)
at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1908)
at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:837)
at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:1005)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:874)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:175)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:403)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3593)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3618)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3733)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3811)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3816)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3927)
at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1799)
at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1789)
at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1799)
at dotty.tools.dotc.typer.Namer.completeParams$1$$anonfun$1(Namer.scala:2003)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:334)
at dotty.tools.dotc.typer.Namer.completeParams$1(Namer.scala:2001)
at dotty.tools.dotc.typer.Namer.completeTrailingParamss$$anonfun$2(Namer.scala:2010)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:334)
at dotty.tools.dotc.typer.Namer.completeTrailingParamss(Namer.scala:2010)
at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1948)
at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:845)
at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:1005)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:874)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:175)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:190)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:192)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:403)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:3593)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3618)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3733)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3811)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3816)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3838)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3884)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:3303)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:3634)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3638)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3733)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3811)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3816)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3838)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3884)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:3436)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3680)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3734)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3811)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3816)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3927)
at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:47)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:510)
at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:53)
at dotty.tools.dotc.typer.TyperPhase.$anonfun$4(TyperPhase.scala:99)
at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:479)
at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:583)
at scala.collection.immutable.List.prependedAll(List.scala:152)
at scala.collection.immutable.List$.from(List.scala:685)
at scala.collection.immutable.List$.from(List.scala:682)
at scala.collection.IterableOps$WithFilter.map(Iterable.scala:900)
at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:98)
at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:368)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1324)
at dotty.tools.dotc.Run.runPhases$1(Run.scala:361)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$2(Run.scala:408)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$adapted$1(Run.scala:408)
at scala.Function0.apply$mcV$sp(Function0.scala:42)
at dotty.tools.dotc.Run.showProgress(Run.scala:470)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:408)
at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:420)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
at dotty.tools.dotc.Run.compileUnits(Run.scala:420)
at dotty.tools.dotc.Run.compileSources(Run.scala:307)
at dotty.tools.dotc.Run.compile(Run.scala:292)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
at dotty.tools.dotc.Driver.process(Driver.scala:201)
at dotty.tools.dotc.Driver.process(Driver.scala:169)
at dotty.tools.dotc.Driver.process(Driver.scala:181)
at dotty.tools.dotc.Driver.main(Driver.scala:211)
at dotty.tools.dotc.Main.main(Main.scala)