@@ -145,11 +145,20 @@ class Definitions {
145145 }
146146
147147 private def enterPolyMethod (cls : ClassSymbol , name : TermName , typeParamCount : Int ,
148- resultTypeFn : PolyType => Type , flags : FlagSet = EmptyFlags ) = {
148+ resultTypeFn : PolyType => Type , flags : FlagSet = EmptyFlags ,
149+ useCompleter : Boolean = false ) = {
149150 val tparamNames = PolyType .syntheticParamNames(typeParamCount)
150151 val tparamInfos = tparamNames map (_ => TypeBounds .empty)
151- val ptype = PolyType (tparamNames)(_ => tparamInfos, resultTypeFn)
152- enterMethod(cls, name, ptype, flags)
152+ def ptype = PolyType (tparamNames)(_ => tparamInfos, resultTypeFn)
153+ val info =
154+ if (useCompleter)
155+ new LazyType {
156+ def complete (denot : SymDenotation )(implicit ctx : Context ): Unit = {
157+ denot.info = ptype
158+ }
159+ }
160+ else ptype
161+ enterMethod(cls, name, info, flags)
153162 }
154163
155164 private def enterT1ParameterlessMethod (cls : ClassSymbol , name : TermName , resultTypeFn : PolyType => Type , flags : FlagSet ) =
@@ -298,11 +307,13 @@ class Definitions {
298307
299308 /** Method representing a term quote */
300309 lazy val quoteMethod = enterPolyMethod(OpsPackageClass , nme.QUOTE , 1 ,
301- pt => MethodType (pt.paramRefs(0 ) :: Nil , QuotedExprType .appliedTo(pt.paramRefs(0 ) :: Nil )))
310+ pt => MethodType (pt.paramRefs(0 ) :: Nil , QuotedExprType .appliedTo(pt.paramRefs(0 ) :: Nil )),
311+ useCompleter = true )
302312
303313 /** Method representing a type quote */
304314 lazy val typeQuoteMethod = enterPolyMethod(OpsPackageClass , nme.QUOTE , 1 ,
305- pt => QuotedTypeType .appliedTo(pt.paramRefs(0 ) :: Nil ))
315+ pt => QuotedTypeType .appliedTo(pt.paramRefs(0 ) :: Nil ),
316+ useCompleter = true )
306317
307318 lazy val NothingClass : ClassSymbol = enterCompleteClassSymbol(
308319 ScalaPackageClass , tpnme.Nothing , AbstractFinal , List (AnyClass .typeRef))
@@ -1093,9 +1104,7 @@ class Definitions {
10931104
10941105 /** Lists core methods that don't have underlying bytecode, but are synthesized on-the-fly in every reflection universe */
10951106 lazy val syntheticCoreMethods =
1096- AnyMethods ++ ObjectMethods ++ List (String_+ , throwMethod
1097- // , quoteMethod, typeQuoteMethod // we omit these because they force Expr and Type too early
1098- )
1107+ AnyMethods ++ ObjectMethods ++ List (String_+ , throwMethod, quoteMethod, typeQuoteMethod)
10991108
11001109 lazy val reservedScalaClassNames : Set [Name ] = syntheticScalaClasses.map(_.name).toSet
11011110
0 commit comments