Skip to content

Commit 93efc19

Browse files
Close lampepfl/dotty-knowledge#11: Share code from Annotations
1 parent cf1c168 commit 93efc19

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ object Annotations {
115115
def apply(atp: Type, args: List[Tree])(implicit ctx: Context): Annotation =
116116
apply(New(atp, args))
117117

118-
private def resolveConstructor(atp: Type, args:List[Tree])(implicit ctx: Context): Tree = {
118+
def resolveConstructor(atp: Type, args:List[Tree])(implicit ctx: Context): Tree = {
119119
val targs = atp.argTypes
120120
tpd.applyOverloaded(New(atp.typeConstructor), nme.CONSTRUCTOR, args, targs, atp)
121121
}

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,11 +934,8 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
934934
}
935935
t.toList
936936
}
937-
// println(atp)
938-
val targs = atp.argTypes
939-
940-
tpd.applyOverloaded(tpd.New(atp.typeConstructor), nme.CONSTRUCTOR, args, targs, atp)
941-
}
937+
Annotations.Annotation.resolveConstructor(atp, args)
938+
}
942939

943940
/** Read an annotation and as a side effect store it into
944941
* the symbol it requests. Called at top-level, for all

0 commit comments

Comments
 (0)