File tree Expand file tree Collapse file tree 5 files changed +41
-6
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 5 files changed +41
-6
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ object SymDenotations {
684
684
isAbstractOrAliasType && ! isAbstractOrParamType
685
685
686
686
/** Is this symbol an abstract or alias type? */
687
- final def isAbstractOrAliasType : Boolean = isType & ! isClass
687
+ final def isAbstractOrAliasType : Boolean = isType && ! isClass
688
688
689
689
/** Is this symbol an abstract type or type parameter? */
690
690
final def isAbstractOrParamType (using Context ): Boolean = this .isOneOf(DeferredOrTypeParam )
Original file line number Diff line number Diff line change @@ -613,14 +613,14 @@ object CheckUnused:
613
613
|| m.hasAnnotation(dd.UnusedAnnot ) // param of unused method
614
614
|| sym.owner.name.isContextFunction // a ubiquitous parameter
615
615
|| sym.isCanEqual
616
- || sym.info.typeSymbol.match // more ubiquity
616
+ || sym.info.dealias. typeSymbol.match // more ubiquity
617
617
case dd.DummyImplicitClass | dd.SubTypeClass | dd.SameTypeClass => true
618
618
case tps =>
619
619
tps.isMarkerTrait // no members to use; was only if sym.name.is(ContextBoundParamName)
620
620
|| // but consider NotGiven
621
621
tps.hasAnnotation(dd.LanguageFeatureMetaAnnot )
622
622
|| sym.info.isSingleton // DSL friendly
623
- || sym.info.isInstanceOf [RefinedType ] // can't be expressed as a context bound
623
+ || sym.info.dealias. isInstanceOf [RefinedType ] // can't be expressed as a context bound
624
624
if ctx.settings.WunusedHas .implicits
625
625
&& ! infos.skip(m)
626
626
&& ! m.isEffectivelyOverride
@@ -943,7 +943,7 @@ object CheckUnused:
943
943
def isCanEqual : Boolean =
944
944
sym.isOneOf(GivenOrImplicit ) && sym.info.finalResultType.baseClasses.exists(_.derivesFrom(defn.CanEqualClass ))
945
945
def isMarkerTrait : Boolean =
946
- sym.isClass && sym. info.allMembers.forall: d =>
946
+ sym.info.hiBound .allMembers.forall: d =>
947
947
val m = d.symbol
948
948
! m.isTerm || m.isSelfSym || m.is(Method ) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass )
949
949
def isEffectivelyPrivate : Boolean =
Original file line number Diff line number Diff line change 1
- //> using options -Wunused:all -deprecation -feature
1
+ //> using options -Wunused:all -deprecation -feature -Werror
2
2
3
3
import java .net .URI
4
4
@@ -10,7 +10,7 @@ object circelike {
10
10
type Configuration
11
11
trait ConfiguredCodec [T ]
12
12
object ConfiguredCodec :
13
- inline final def derived [A ](using conf : Configuration )(using inline mirror : Mirror .Of [A ]): ConfiguredCodec [A ] = // warn // warn
13
+ inline final def derived [A ](using conf : Configuration )(using inline mirror : Mirror .Of [A ]): ConfiguredCodec [A ] =
14
14
class InlinedConfiguredCodec extends ConfiguredCodec [A ]:
15
15
val codec = summonInline[Codec [URI ]] // simplification
16
16
new InlinedConfiguredCodec
Original file line number Diff line number Diff line change
1
+ //> using options -Wunused:all -Werror
2
+
3
+ trait MonadError [F [_], E ]
4
+ type MonadThrow [F [_]] = MonadError [F , Throwable ]
5
+
6
+ trait MetaStreams [F [_]]:
7
+ def use [A ]: F [A ] = ???
8
+ trait WriteResult
9
+
10
+ trait MetaStreamsSyntax :
11
+ extension [F [_]](ms : MetaStreams [F ])(using MonadThrow [F ])
12
+ def setMaxAge (): F [WriteResult ] =
13
+ summon[MonadThrow [F ]]
14
+ ms.use[WriteResult ]
15
+
16
+ def setTruncateBefore (): F [WriteResult ] =
17
+ ms.use[WriteResult ]
Original file line number Diff line number Diff line change
1
+ //> using options -Wunused:all
2
+
3
+ trait Memberly :
4
+ def member : Int
5
+
6
+ object Members :
7
+ type MemberType <: Memberly
8
+ type Empty
9
+
10
+ object Test :
11
+ import Members .*
12
+
13
+ type MT = MemberType
14
+ def membered (using MT ) = println() // warn abstract type offers member in upper bound
15
+ def remembered (using mt : MT ) = mt.member
16
+
17
+ type Ignore = Empty
18
+ def emptily (using Ignore ) = println()
You can’t perform that action at this time.
0 commit comments