File tree 2 files changed +6
-34
lines changed
2 files changed +6
-34
lines changed Original file line number Diff line number Diff line change @@ -293,21 +293,17 @@ class LazyMacros(val c: whitebox.Context) extends CaseClassMacros with OpenImpli
293
293
294
294
private var current = Option .empty[State ]
295
295
296
- private def typeParamsToWildcards (tpe : Type ): Type = tpe.map { t =>
297
- val sym = t.typeSymbol
298
- if (sym.isParameter) boundedWildcardType(sym.info.asInstanceOf [TypeBounds ]) else t
299
- }
300
-
301
296
def resolveInstance (state : State )(tpe : Type ): Option [(State , Tree )] = {
302
297
val former = State .current
303
298
State .current = Some (state)
304
299
val (state0, tree) =
305
300
try {
306
- val tree = c.inferImplicitValue(tpe, silent = true ) orElse c.inferImplicitValue(typeParamsToWildcards(tpe), silent = true )
307
- if (tree.isEmpty) {
308
- tpe.typeSymbol.annotations
309
- .find(_.tree.tpe =:= typeOf[_root_.scala.annotation.implicitNotFound])
310
- .foreach(_ => setAnnotation(implicitNotFoundMessage(c)(tpe)))
301
+ val tree = c.inferImplicitValue(tpe, silent = true )
302
+ if (tree.isEmpty) {
303
+ tpe.typeSymbol.annotations.
304
+ find(_.tree.tpe =:= typeOf[_root_.scala.annotation.implicitNotFound]).foreach { _ =>
305
+ setAnnotation(implicitNotFoundMessage(c)(tpe))
306
+ }
311
307
}
312
308
(State .current.get, tree)
313
309
} finally {
Original file line number Diff line number Diff line change @@ -334,27 +334,3 @@ class LazyStrictTests {
334
334
implicitly[Strict [Readable [Id ]]]
335
335
}
336
336
}
337
-
338
- object TestLazyWithTypeParametersAndBounds {
339
- trait Foo
340
- case class BarFoo (i : Int ) extends Foo
341
-
342
- trait Fooer [Tpe , FooTpe ] {
343
- def makeFoo (obj : Tpe ): FooTpe
344
- }
345
-
346
- object Fooer {
347
- implicit val barFooer : Fooer [Int , BarFoo ] = null
348
- }
349
-
350
- class Finder [Tpe ] {
351
- def find [F <: Foo ](implicit fooer : Fooer [Tpe , F ]) = fooer
352
- def findLazy [F <: Foo ](implicit fooer : Lazy [Fooer [Tpe , F ]]) = fooer
353
- def findNoBounds [F ](implicit fooer : Lazy [Fooer [Tpe , F ]]) = fooer
354
- }
355
-
356
- val intFinder = new Finder [Int ]
357
- intFinder.find
358
- intFinder.findLazy
359
- intFinder.findNoBounds
360
- }
You can’t perform that action at this time.
0 commit comments