File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
compiler/src/dotty/tools/dotc
tests/neg-custom-args/isInstanceOf Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -805,7 +805,7 @@ object Trees {
805
805
def unforced : AnyRef
806
806
protected def force (x : AnyRef ): Unit
807
807
def forceIfLazy (implicit ctx : Context ): T = unforced match {
808
- case lzy : Lazy [T ] =>
808
+ case lzy : Lazy [T @ unchecked ] =>
809
809
val x = lzy.complete
810
810
force(x)
811
811
x
Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ object Checkable {
64
64
65
65
def replaceBinderMap (implicit ctx : Context ) = new TypeMap {
66
66
def apply (tp : Type ) = tp match {
67
- case tref : TypeRef if ! tref.typeSymbol.isClass && tref.symbol.is(Case ) => WildcardType
67
+ case tref : TypeRef
68
+ if ! tref.typeSymbol.isClass && tref.symbol.is(Case ) => WildcardType
69
+ case AnnotatedType (_, annot)
70
+ if annot.symbol == defn.UncheckedAnnot => WildcardType
68
71
case _ => mapOver(tp)
69
72
}
70
73
}
Original file line number Diff line number Diff line change @@ -55,4 +55,7 @@ object Test {
55
55
println(f3(Array (1L )))
56
56
println(f3(null ))
57
57
}
58
+
59
+ def foo (x : Any ): Boolean =
60
+ x.isInstanceOf [List [String ]] // error
58
61
}
You can’t perform that action at this time.
0 commit comments