Skip to content

Commit 8f04ba5

Browse files
committed
Simplify ReflectionImpl
1 parent b6b8f1e commit 8f04ba5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionImpl.scala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@ package dotty.tools.dotc.tastyreflect
33
import dotty.tools.dotc.core._
44
import dotty.tools.dotc.util.{SourcePosition, Spans}
55

6-
class ReflectionImpl private (ctx: Contexts.Context, pos: SourcePosition)
7-
extends scala.tasty.Reflection {
8-
9-
val kernel: KernelImpl = new KernelImpl(ctx, pos)
10-
11-
}
12-
136
object ReflectionImpl {
147

15-
def apply(rootContext: Contexts.Context): ReflectionImpl =
8+
def apply(rootContext: Contexts.Context): scala.tasty.Reflection { val kernel: KernelImpl } =
169
apply(rootContext, SourcePosition(rootContext.source, Spans.NoSpan))
1710

18-
def apply(rootContext: Contexts.Context, rootPosition: SourcePosition): ReflectionImpl =
19-
new ReflectionImpl(rootContext, rootPosition)
11+
def apply(rootContext: Contexts.Context, rootPosition: SourcePosition): scala.tasty.Reflection { val kernel: KernelImpl } = {
12+
class ReflectionImpl(val kernel: KernelImpl) extends scala.tasty.Reflection
13+
new ReflectionImpl(new KernelImpl(rootContext, rootPosition))
14+
}
2015

2116
}

0 commit comments

Comments
 (0)