File tree 3 files changed +21
-2
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,10 @@ trait ImplicitRunInfo {
509
509
/** Is `sym` an anchor type for which givens may exist? Anchor types are classes,
510
510
* opaque type aliases, and abstract types, but not type parameters
511
511
*/
512
- def isAnchor (sym : Symbol ) = sym.isClass && ! sym.is(Package ) || sym.isOpaqueAlias
512
+ def isAnchor (sym : Symbol ) =
513
+ sym.isClass && ! sym.is(Package )
514
+ || sym.isOpaqueAlias
515
+ || sym.is(Deferred , butNot = Param )
513
516
514
517
def anchors (tp : Type ): List [Type ] = tp match {
515
518
case tp : NamedType if isAnchor(tp.symbol) => tp :: Nil
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ object Test {
3
3
def impl (receiver : Expr [StringContext ])(using qctx : scala.quoted.QuoteContext ) = {
4
4
import qctx .tasty .Repeated
5
5
receiver match {
6
- case ' { StringContext ($ {Repeated (parts)}: _* ) } => // error
6
+ case ' { StringContext ($ {Repeated (parts)}: _* ) } => // now OK
7
7
}
8
8
}
9
9
}
Original file line number Diff line number Diff line change
1
+ trait Show [A ]:
2
+ def show (a : A ): String = a.toString
3
+
4
+ object Prefix :
5
+ type AbstractType
6
+ type UpperBoundedType <: String
7
+ type FullyBoundedType >: String <: String
8
+
9
+ given A as Show [AbstractType ]
10
+ given B as Show [UpperBoundedType ]
11
+ given C as Show [FullyBoundedType ]
12
+
13
+ @ main def Test =
14
+ summon[Show [Prefix .AbstractType ]]
15
+ summon[Show [Prefix .UpperBoundedType ]]
16
+ summon[Show [Prefix .FullyBoundedType ]]
You can’t perform that action at this time.
0 commit comments