summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Infer.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Infer.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index e096b75d6d..3be4a46a79 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1366,14 +1366,16 @@ trait Infer {
else if (param.isContravariant) >:>
else =:=
)
- val TypeRef(_, sym, args) = arg
-
- ( isLocalBinding(sym)
- || arg.typeSymbol.isTypeParameterOrSkolem
- || (sym.name == tpnme.WILDCARD) // avoid spurious warnings on HK types
- || check(arg, param.tpe, conforms)
- || warn("non-variable type argument " + arg)
- )
+ (arg hasAnnotation UncheckedClass) || {
+ val TypeRef(_, sym, args) = arg.withoutAnnotations
+
+ ( isLocalBinding(sym)
+ || arg.typeSymbol.isTypeParameterOrSkolem
+ || (sym.name == tpnme.WILDCARD) // avoid spurious warnings on HK types
+ || check(arg, param.tpe, conforms)
+ || warn("non-variable type argument " + arg)
+ )
+ }
}
// Checking if pt (the expected type of the pattern, and the type
@@ -1404,8 +1406,11 @@ trait Infer {
case _ =>
def where = ( if (inPattern) "pattern " else "" ) + typeToTest
if (check(typeToTest, typeEnsured, =:=)) ()
+ // Note that this is a regular warning, not an uncheckedWarning,
+ // which is now the province of such notifications as "pattern matcher
+ // exceeded its analysis budget."
else warningMessages foreach (m =>
- context.unit.uncheckedWarning(tree.pos, s"$m in type $where is unchecked since it is eliminated by erasure"))
+ context.unit.warning(tree.pos, s"$m in type $where is unchecked since it is eliminated by erasure"))
}
}