File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -964,7 +964,7 @@ object CheckUnused:
964964 def isCanEqual : Boolean =
965965 sym.isOneOf(GivenOrImplicit ) && sym.info.finalResultType.baseClasses.exists(_.derivesFrom(defn.CanEqualClass ))
966966 def isMarkerTrait : Boolean =
967- sym.info.hiBound.allMembers.forall: d =>
967+ sym.info.hiBound.resultType. allMembers.forall: d =>
968968 val m = d.symbol
969969 ! m.isTerm || m.isSelfSym || m.is(Method ) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass )
970970 def isEffectivelyPrivate : Boolean =
Original file line number Diff line number Diff line change 1- //> using options -Wunused:implicits
1+ //> using options -Wunused:implicits
22
33/* This goes around the "trivial method" detection */
44val default_int = 1
@@ -58,6 +58,8 @@ package givens:
5858 trait Y :
5959 def doY : String
6060
61+ trait Z
62+
6163 given X with
6264 def doX = 7
6365
@@ -75,6 +77,9 @@ package givens:
7577
7678 given namely (using x : X ): Y with // warn protected param to given class
7779 def doY = " 8"
80+
81+ def f (using => X ) = println() // warn
82+ def g (using => Z ) = println() // nowarn marker trait
7883end givens
7984
8085object i22895 :
Original file line number Diff line number Diff line change 1+ //> using options -Wunused:implicits
2+
3+ import scala .deriving .Mirror
4+
5+ abstract class EnumerationValues [A ]:
6+ type Out
7+
8+ object EnumerationValues :
9+ type Aux [A , B ] = EnumerationValues [A ] { type Out = B }
10+
11+ def apply [A , B ](): EnumerationValues .Aux [A , B ] = new EnumerationValues [A ]:
12+ override type Out = B
13+
14+ given sum [A , B <: Tuple ](using mirror : Mirror .SumOf [A ] { type MirroredElemTypes = B }): EnumerationValues .Aux [A , A ] =
15+ EnumerationValues [A , A ]()
You can’t perform that action at this time.
0 commit comments