Skip to content

Commit 102269e

Browse files
Improve error message, remove unused method
1 parent f6e171b commit 102269e

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class Compiler {
9292
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
9393
new StringInterpolatorOpt, // Optimizes raw and s and f string interpolators by rewriting them to string concatenations or formats
9494
new DropBreaks) :: // Optimize local Break throws by rewriting them
95-
List(new PruneInlineTraits,
95+
List(new PruneInlineTraits, // Remove right-hand side of definitions in inline traits
9696
new PruneErasedDefs, // Drop erased definitions from scopes and simplify erased expressions
9797
new UninitializedDefs, // Replaces `compiletime.uninitialized` by `_`
9898
new InlinePatterns, // Remove placeholders of inlined patterns

compiler/src/dotty/tools/dotc/transform/SpecializeInlineTraits.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,10 @@ class SpecializeInlineTraits extends MacroTransform, SymTransformer {
5757

5858
override def checkPostCondition(tree: Tree)(using Context): Unit =
5959
tree match {
60-
// TODO
60+
// TODO check that things are inlined properly
6161
case _ =>
6262
}
6363

64-
extension (tree: Tree)
65-
private def hasSpecializedVersion: Boolean =
66-
false
67-
6864
private def transformInlineTrait(inlineTrait: TypeDef)(using Context): TypeDef =
6965
val tpd.TypeDef(_, tmpl: Template) = inlineTrait: @unchecked
7066
val body1 = tmpl.body.flatMap {

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
26812681
case tdef: TypeDef if tdef.symbol.isClass =>
26822682
def rec(paramss: List[List[Symbol]]): Unit = paramss match {
26832683
case (param :: _) :: _ if param.isTerm =>
2684-
report.error(em"Implementation restriction: inline traits cannot have term parameters", param.srcPos)
2684+
report.error(em"Implementation restriction: inner classes inside inline traits cannot have term parameters", param.srcPos)
26852685
case _ :: paramss =>
26862686
rec(paramss)
26872687
case _ =>

0 commit comments

Comments
 (0)