aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/UnPickler.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-30 16:20:57 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-11-22 20:10:20 +0100
commit11449db93f426a3fc64eded180852661d889804e (patch)
tree0add44f1650789ceac91906a7447c61d3b1828c3 /src/dotty/tools/dotc/core/pickling/UnPickler.scala
parent68dfe2a7619edfb9829876643c9177723a40bb84 (diff)
downloaddotty-11449db93f426a3fc64eded180852661d889804e.tar.gz
dotty-11449db93f426a3fc64eded180852661d889804e.tar.bz2
dotty-11449db93f426a3fc64eded180852661d889804e.zip
Infer if overloading resolution should trigger implicit search.
This doesn't require additional argument. Decision can be made solely from the phaseId.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala61
1 files changed, 28 insertions, 33 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index b165f91fa..aa277d6b0 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -815,42 +815,37 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
* readAnnotation, readSymbolAnnotation, or readAnnotInfoArg
*/
protected def readAnnotationContents(end: Int)(implicit ctx: Context): Tree = {
- ctx.atPhase(ctx.typerPhase) { implicit ctx => // needed to enable implicit search
- // and fix circullar dependency between annotation.currect invoking
- // elimrepeated that reads the same annotation
-
- val atp = readTypeRef()
- val args = {
- val t = new ListBuffer[Tree]
-
- while (readIndex != end) {
- val argref = readNat()
- t += {
- if (isNameEntry(argref)) {
- val name = at(argref, readName)
- val arg = readClassfileAnnotArg(readNat())
- NamedArg(name.asTermName, arg)
- } else readAnnotArg(argref)
- }
+ val atp = readTypeRef()
+ val args = {
+ val t = new ListBuffer[Tree]
+
+ while (readIndex != end) {
+ val argref = readNat()
+ t += {
+ if (isNameEntry(argref)) {
+ val name = at(argref, readName)
+ val arg = readClassfileAnnotArg(readNat())
+ NamedArg(name.asTermName, arg)
+ } else readAnnotArg(argref)
}
- t.toList
}
- println(atp)
- val typer = ctx.typer
- val proto = new FunProtoTyped(args, atp, typer)
- val alts = atp.member(nme.CONSTRUCTOR).alternatives.map(_.termRef)
-
- val constructors = ctx.typer.resolveOverloaded(alts, proto, Nil, false)
- assert(constructors.size == 1) // this is parsed from bytecode tree. there's nothing user can do about it
-
- val constr = constructors.head
- val targs = atp.argTypes
- val fun = tpd.New(atp withoutArgs targs)
- .select(TermRef.withSig(atp.normalizedPrefix, constr.termSymbol.asTerm))
- .appliedToTypes(targs)
- val apply = untpd.Apply(fun, args)
- new typer.ApplyToTyped(apply, fun, constr, args, atp).result // needed to handle varargs
+ t.toList
}
+ println(atp)
+ val typer = ctx.typer
+ val proto = new FunProtoTyped(args, atp, typer)
+ val alts = atp.member(nme.CONSTRUCTOR).alternatives.map(_.termRef)
+
+ val constructors = ctx.typer.resolveOverloaded(alts, proto, Nil)
+ assert(constructors.size == 1) // this is parsed from bytecode tree. there's nothing user can do about it
+
+ val constr = constructors.head
+ val targs = atp.argTypes
+ val fun = tpd.New(atp withoutArgs targs)
+ .select(TermRef.withSig(atp.normalizedPrefix, constr.termSymbol.asTerm))
+ .appliedToTypes(targs)
+ val apply = untpd.Apply(fun, args)
+ new typer.ApplyToTyped(apply, fun, constr, args, atp).result // needed to handle varargs
}
/** Read an annotation and as a side effect store it into