File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,10 @@ trait ImplicitRunInfo {
509509 /** Is `sym` an anchor type for which givens may exist? Anchor types are classes,
510510 * opaque type aliases, and abstract types, but not type parameters
511511 */
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 )
513516
514517 def anchors (tp : Type ): List [Type ] = tp match {
515518 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 {
33 def impl (receiver : Expr [StringContext ])(using qctx : scala.quoted.QuoteContext ) = {
44 import qctx .tasty .Repeated
55 receiver match {
6- case ' { StringContext ($ {Repeated (parts)}: _* ) } => // error
6+ case ' { StringContext ($ {Repeated (parts)}: _* ) } => // now OK
77 }
88 }
99}
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