Skip to content

Commit 5c09ad8

Browse files
committed
Simplify ReflectionImpl
1 parent 6b2a676 commit 5c09ad8

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +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-
with CoreImpl
9-
with CommentOpsImpl {
10-
11-
val kernel: KernelImpl = new KernelImpl(ctx, pos)
12-
13-
}
14-
156
object ReflectionImpl {
167

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

20-
def apply(rootContext: Contexts.Context, rootPosition: SourcePosition): ReflectionImpl =
21-
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 with CoreImpl with CommentOpsImpl
13+
new ReflectionImpl(new KernelImpl(rootContext, rootPosition))
14+
}
2215

2316
}

0 commit comments

Comments
 (0)