diff --git a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala index 928d19c92041..109fac06d63a 100644 --- a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala +++ b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala @@ -186,7 +186,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) { private final class DirEntryWriter(base: Path) extends FileWriter { val builtPaths = new ConcurrentHashMap[Path, java.lang.Boolean]() - val noAttributes = Array.empty[FileAttribute[_]] + val noAttributes = Array.empty[FileAttribute[?]] private val isWindows = scala.util.Properties.isWin private def checkName(component: Path): Unit = if (isWindows) { diff --git a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala index 0e65850d4798..538c288b5ef6 100644 --- a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala +++ b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala @@ -138,7 +138,7 @@ abstract class CoreBTypesFromSymbols[I <: DottyBackendInterface] extends CoreBTy lazy val jlStringBuilderRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.lang.StringBuilder]) lazy val jlStringBufferRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.lang.StringBuffer]) lazy val jlCharSequenceRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.lang.CharSequence]) - lazy val jlClassRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.lang.Class[_]]) + lazy val jlClassRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.lang.Class[?]]) lazy val jlThrowableRef : ClassBType = synchClassBTypeFromSymbol(defn.ThrowableClass) lazy val jlCloneableRef : ClassBType = synchClassBTypeFromSymbol(defn.JavaCloneableClass) lazy val jiSerializableRef : ClassBType = synchClassBTypeFromSymbol(requiredClass[java.io.Serializable]) diff --git a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala index b2278c3f0ce8..c005a6d38403 100644 --- a/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala +++ b/compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala @@ -93,7 +93,7 @@ class DottyBackendInterface(val superCallsMap: ReadOnlyMap[Symbol, Set[ClassSymb object DottyBackendInterface { - private def erasureString(clazz: Class[_]): String = { + private def erasureString(clazz: Class[?]): String = { if (clazz.isArray) "Array[" + erasureString(clazz.getComponentType) + "]" else clazz.getName } diff --git a/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala b/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala index c16bc70fc3b0..71bf307266c5 100644 --- a/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala +++ b/compiler/src/dotty/tools/backend/jvm/GenericSignatureVisitor.scala @@ -315,7 +315,7 @@ abstract class NestedClassesCollector[T](nestedOnly: Boolean) extends GenericSig if (annot.values != null) annot.values.asScala foreach visitConstant } - def visitAnnotations(annots: java.util.List[_ <: AnnotationNode]) = if (annots != null) annots.asScala foreach visitAnnotation + def visitAnnotations(annots: java.util.List[? <: AnnotationNode]) = if (annots != null) annots.asScala foreach visitAnnotation def visitAnnotationss(annotss: Array[java.util.List[AnnotationNode]]) = if (annotss != null) annotss foreach visitAnnotations def visitHandle(handle: Handle): Unit = { diff --git a/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala b/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala index 6edb15fb24a7..fa8f99fc0e03 100644 --- a/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala +++ b/compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala @@ -1089,7 +1089,7 @@ class JSCodeGen()(using genCtx: Context) { val exports = List.newBuilder[jsExportsGen.Exported] val jsClassCaptures = List.newBuilder[js.ParamDef] - def add(tree: ConstructorTree[_ <: JSCtor]): Unit = { + def add(tree: ConstructorTree[? <: JSCtor]): Unit = { val (e, c) = genJSClassCtorDispatch(tree.ctor.sym, tree.ctor.paramsAndInfo, tree.overloadNum) exports += e @@ -1270,7 +1270,7 @@ class JSCodeGen()(using genCtx: Context) { * here we use the property from building the trees, that a set of * descendants always has a range of overload numbers. */ - def ifOverload(tree: ConstructorTree[_], body: js.Tree): js.Tree = body match { + def ifOverload(tree: ConstructorTree[?], body: js.Tree): js.Tree = body match { case js.Skip() => js.Skip() case body => diff --git a/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala b/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala index be5b8e7bb416..fd271685989c 100644 --- a/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala +++ b/compiler/src/dotty/tools/backend/sjs/ScopedVar.scala @@ -28,7 +28,7 @@ object ScopedVar { implicit def toValue[T](scVar: ScopedVar[T]): T = scVar.get - def withScopedVars[T](ass: Assignment[_]*)(body: => T): T = { + def withScopedVars[T](ass: Assignment[?]*)(body: => T): T = { val stack = ass.map(_.push()) try body finally stack.reverse.foreach(_.pop()) diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index 23dcfe392c27..7616ef220d7f 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -242,7 +242,7 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] => /** Does this list contain a named argument tree? */ def hasNamedArg(args: List[Any]): Boolean = args exists isNamedArg - val isNamedArg: Any => Boolean = (arg: Any) => arg.isInstanceOf[Trees.NamedArg[_]] + val isNamedArg: Any => Boolean = (arg: Any) => arg.isInstanceOf[Trees.NamedArg[?]] /** Is this pattern node a catch-all (wildcard or variable) pattern? */ def isDefaultCase(cdef: CaseDef): Boolean = cdef match { @@ -1060,7 +1060,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => def assertAllPositioned(tree: Tree)(using Context): Unit = tree.foreachSubTree { - case t: WithoutTypeOrPos[_] => + case t: WithoutTypeOrPos[?] => case t => assert(t.span.exists, i"$t") } diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 6941596e1c9b..1ad8bf520830 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -31,7 +31,7 @@ object Trees { /** Property key for backquoted identifiers and definitions */ val Backquoted: Property.StickyKey[Unit] = Property.StickyKey() - + val SyntheticUnit: Property.StickyKey[Unit] = Property.StickyKey() /** Trees take a parameter indicating what the type of their `tpe` field @@ -932,11 +932,11 @@ object Trees { def rhs(using Context): Tree[T] = { forceFields(); preRhs.asInstanceOf[Tree[T]] } def leadingTypeParams(using Context): List[TypeDef[T]] = paramss match - case (tparams @ (tparam: TypeDef[_]) :: _) :: _ => tparams.asInstanceOf[List[TypeDef[T]]] + case (tparams @ (tparam: TypeDef[?]) :: _) :: _ => tparams.asInstanceOf[List[TypeDef[T]]] case _ => Nil def trailingParamss(using Context): List[ParamClause[T]] = paramss match - case ((tparam: TypeDef[_]) :: _) :: paramss1 => paramss1 + case ((tparam: TypeDef[?]) :: _) :: paramss1 => paramss1 case _ => paramss def termParamss(using Context): List[List[ValDef[T]]] = diff --git a/compiler/src/dotty/tools/dotc/config/Feature.scala b/compiler/src/dotty/tools/dotc/config/Feature.scala index f1443ad56442..f70b9861aaec 100644 --- a/compiler/src/dotty/tools/dotc/config/Feature.scala +++ b/compiler/src/dotty/tools/dotc/config/Feature.scala @@ -26,6 +26,7 @@ object Feature: val dependent = experimental("dependent") val erasedDefinitions = experimental("erasedDefinitions") val symbolLiterals = deprecated("symbolLiterals") + val underscoreWildcards = deprecated("underscoreWildcards") val fewerBraces = experimental("fewerBraces") val saferExceptions = experimental("saferExceptions") val clauseInterleaving = experimental("clauseInterleaving") diff --git a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala index b7bfdcf80e24..8d594448dc2a 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala @@ -649,13 +649,13 @@ class Inliner(val call: tpd.Tree)(using Context): def treeSize(x: Any): Int = var siz = 0 x match - case x: Trees.Inlined[_] => + case x: Trees.Inlined[?] => case x: Positioned => var i = 0 while i < x.productArity do siz += treeSize(x.productElement(i)) i += 1 - case x: List[_] => + case x: List[?] => var xs = x while xs.nonEmpty do siz += treeSize(xs.head) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 48653ad96197..2af52721cb80 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1856,9 +1856,12 @@ object Parsers { val start = in.skipToken() Ident(tpnme.USCOREkw).withSpan(Span(start, in.lastOffset, start)) else - if sourceVersion.isAtLeast(future) then - deprecationWarning(em"`_` is deprecated for wildcard arguments of types: use `?` instead") - patch(source, Span(in.offset, in.offset + 1), "?") + if !in.featureEnabled(Feature.underscoreWildcards) then + report.errorOrMigrationWarning( + em"`_` is deprecated for wildcard arguments of types: use `?` instead${rewriteNotice(`3.4-migration`)}", + in.sourcePos(), from = `3.4`) + if sourceVersion == `3.4-migration` then + patch(source, Span(in.offset, in.offset + 1), "?") val start = in.skipToken() typeBounds().withSpan(Span(start, in.lastOffset, start)) // Allow symbols -_ and +_ through for compatibility with code written using kind-projector in Scala 3 underscore mode. diff --git a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala index 3e6a8c66b1b1..60a25413d8e5 100644 --- a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -160,7 +160,7 @@ class PlainPrinter(_ctx: Context) extends Printer { core ~ cs.optionalInfo private def toTextRetainedElem[T <: Untyped](ref: Tree[T]): Text = ref match - case ref: RefTree[_] if ref.typeOpt.exists => + case ref: RefTree[?] if ref.typeOpt.exists => toTextCaptureRef(ref.typeOpt) case Apply(fn, Literal(str) :: Nil) if fn.symbol == defn.Caps_capIn => s"cap[${str.stringValue}]" diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index ae182ad211c0..3770d5f6f119 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -2648,7 +2648,7 @@ class ExtensionCanOnlyHaveDefs(mdef: untpd.Tree)(using Context) |""" } -class UnexpectedPatternForSummonFrom(tree: Tree[_])(using Context) +class UnexpectedPatternForSummonFrom(tree: Tree[?])(using Context) extends SyntaxMsg(UnexpectedPatternForSummonFromID) { def msg(using Context) = i"Unexpected pattern for summonFrom. Expected ${hl("`x: T`")} or ${hl("`_`")}" def explain(using Context) = diff --git a/compiler/src/dotty/tools/dotc/util/Stats.scala b/compiler/src/dotty/tools/dotc/util/Stats.scala index 5157de832d3c..5e136856b718 100644 --- a/compiler/src/dotty/tools/dotc/util/Stats.scala +++ b/compiler/src/dotty/tools/dotc/util/Stats.scala @@ -32,7 +32,7 @@ import collection.mutable hits(name) += n } - def doRecordSize(fn: String, coll: scala.collection.Iterable[_]): coll.type = + def doRecordSize(fn: String, coll: scala.collection.Iterable[?]): coll.type = doRecord(fn, coll.size) coll diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index f94aa12bd2d7..0f64d6e23b8e 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -1779,7 +1779,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler def show(using printer: Printer[TypeRepr]): String = printer.show(self) - def seal: scala.quoted.Type[_] = self.asType + def seal: scala.quoted.Type[?] = self.asType def asType: scala.quoted.Type[?] = new TypeImpl(Inferred(self), SpliceScope.getCurrent) diff --git a/compiler/test/dotty/tools/backend/jvm/AsmNode.scala b/compiler/test/dotty/tools/backend/jvm/AsmNode.scala index caaf250eeafa..046e93e0cfa2 100644 --- a/compiler/test/dotty/tools/backend/jvm/AsmNode.scala +++ b/compiler/test/dotty/tools/backend/jvm/AsmNode.scala @@ -28,7 +28,7 @@ sealed trait AsmNode[+T] { object AsmNode { type AsmMethod = AsmNode[MethodNode] type AsmField = AsmNode[FieldNode] - type AsmMember = AsmNode[_] + type AsmMember = AsmNode[?] implicit class ClassNodeOps(val node: ClassNode) { def fieldsAndMethods: List[AsmMember] = { diff --git a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala index 6b7af09d4a2d..8a9611a9b165 100644 --- a/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala +++ b/compiler/test/dotty/tools/backend/jvm/DottyBytecodeTest.scala @@ -202,7 +202,7 @@ trait DottyBytecodeTest { assert(succ, msg) } - private def sameCharacteristics(clazzA: ClassNode, clazzB: ClassNode)(f: AsmNode[_] => String): (Boolean, String) = { + private def sameCharacteristics(clazzA: ClassNode, clazzB: ClassNode)(f: AsmNode[?] => String): (Boolean, String) = { val ms1 = clazzA.fieldsAndMethods.toIndexedSeq val ms2 = clazzB.fieldsAndMethods.toIndexedSeq val name1 = clazzA.name @@ -254,7 +254,7 @@ trait DottyBytecodeTest { } .getOrElse(fail("Could not find constructor for object `Test`")) - private def boxingError(ins: List[_], source: String) = + private def boxingError(ins: List[?], source: String) = s"""|---------------------------------- |${ins.mkString("\n")} |---------------------------------- @@ -271,7 +271,7 @@ trait DottyBytecodeTest { } .getOrElse(fail("Could not find constructor for object `Test`")) - protected def boxingInstructions(method: MethodNode): (List[_], Boolean) = { + protected def boxingInstructions(method: MethodNode): (List[?], Boolean) = { val ins = instructionsFromMethod(method) val boxed = ins.exists { case Invoke(op, owner, name, desc, itf) => diff --git a/library/src-bootstrapped/scala/runtime/TupledFunctions.scala b/library/src-bootstrapped/scala/runtime/TupledFunctions.scala index c4010de1c754..52b39dedbf76 100644 --- a/library/src-bootstrapped/scala/runtime/TupledFunctions.scala +++ b/library/src-bootstrapped/scala/runtime/TupledFunctions.scala @@ -13,146 +13,146 @@ object TupledFunctions { def tupledFunction1[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( tupledImpl = (f: F) => ((args: Tuple1[Any]) => f.asInstanceOf[Any => Any].apply(args._1)).asInstanceOf[G], - untupledImpl = (g: G) => ((x1: Any) => g.asInstanceOf[Tuple1[_] => Any].apply(Tuple1(x1))).asInstanceOf[F] + untupledImpl = (g: G) => ((x1: Any) => g.asInstanceOf[Tuple1[?] => Any].apply(Tuple1(x1))).asInstanceOf[F] ) def tupledFunction2[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function2[_, _, _]].tupled.asInstanceOf[G], - untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple2[_, _] => Any]).asInstanceOf[F] + tupledImpl = (f: F) => f.asInstanceOf[Function2[?, ?, ?]].tupled.asInstanceOf[G], + untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple2[?, ?] => Any]).asInstanceOf[F] ) def tupledFunction3[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function3[_, _, _, _]].tupled.asInstanceOf[G], - untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple3[_, _, _] => Any]).asInstanceOf[F] + tupledImpl = (f: F) => f.asInstanceOf[Function3[?, ?, ?, ?]].tupled.asInstanceOf[G], + untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple3[?, ?, ?] => Any]).asInstanceOf[F] ) def tupledFunction4[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function4[_, _, _, _, _]].tupled.asInstanceOf[G], - untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple4[_, _, _, _] => Any]).asInstanceOf[F] + tupledImpl = (f: F) => f.asInstanceOf[Function4[?, ?, ?, ?, ?]].tupled.asInstanceOf[G], + untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple4[?, ?, ?, ?] => Any]).asInstanceOf[F] ) def tupledFunction5[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function5[_, _, _, _, _, _]].tupled.asInstanceOf[G], - untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple5[_, _, _, _, _] => Any]).asInstanceOf[F] + tupledImpl = (f: F) => f.asInstanceOf[Function5[?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], + untupledImpl = (g: G) => Function.untupled(g.asInstanceOf[Tuple5[?, ?, ?, ?, ?] => Any]).asInstanceOf[F] ) def tupledFunction6[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function6[_, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function6[?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any) => - g.asInstanceOf[Tuple6[_, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6))).asInstanceOf[F] + g.asInstanceOf[Tuple6[?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6))).asInstanceOf[F] ) def tupledFunction7[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function7[_, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function7[?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any) => - g.asInstanceOf[Tuple7[_, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7))).asInstanceOf[F] + g.asInstanceOf[Tuple7[?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7))).asInstanceOf[F] ) def tupledFunction8[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function8[_, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function8[?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any) => - g.asInstanceOf[Tuple8[_, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8))).asInstanceOf[F] + g.asInstanceOf[Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8))).asInstanceOf[F] ) def tupledFunction9[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function9[_, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function9[?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any) => - g.asInstanceOf[Tuple9[_, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9))).asInstanceOf[F] + g.asInstanceOf[Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9))).asInstanceOf[F] ) def tupledFunction10[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function10[_, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any) => - g.asInstanceOf[Tuple10[_, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10))).asInstanceOf[F] + g.asInstanceOf[Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10))).asInstanceOf[F] ) def tupledFunction11[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function11[_, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any) => - g.asInstanceOf[Tuple11[_, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11))).asInstanceOf[F] + g.asInstanceOf[Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11))).asInstanceOf[F] ) def tupledFunction12[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function12[_, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any) => - g.asInstanceOf[Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12))).asInstanceOf[F] + g.asInstanceOf[Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12))).asInstanceOf[F] ) def tupledFunction13[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function13[_, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any) => - g.asInstanceOf[Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13))).asInstanceOf[F] + g.asInstanceOf[Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13))).asInstanceOf[F] ) def tupledFunction14[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function14[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any) => - g.asInstanceOf[Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14))).asInstanceOf[F] + g.asInstanceOf[Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14))).asInstanceOf[F] ) def tupledFunction15[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any) => - g.asInstanceOf[Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15))).asInstanceOf[F] + g.asInstanceOf[Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15))).asInstanceOf[F] ) def tupledFunction16[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any) => - g.asInstanceOf[Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16))).asInstanceOf[F] + g.asInstanceOf[Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16))).asInstanceOf[F] ) def tupledFunction17[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any) => - g.asInstanceOf[Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17))).asInstanceOf[F] + g.asInstanceOf[Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17))).asInstanceOf[F] ) def tupledFunction18[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any, x18: Any) => - g.asInstanceOf[Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18))).asInstanceOf[F] + g.asInstanceOf[Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18))).asInstanceOf[F] ) def tupledFunction19[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any, x18: Any, x19: Any) => - g.asInstanceOf[Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19))).asInstanceOf[F] + g.asInstanceOf[Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19))).asInstanceOf[F] ) def tupledFunction20[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any, x18: Any, x19: Any, x20: Any) => - g.asInstanceOf[Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20))).asInstanceOf[F] + g.asInstanceOf[Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20))).asInstanceOf[F] ) def tupledFunction21[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any, x18: Any, x19: Any, x20: Any, x21: Any) => - g.asInstanceOf[Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21))).asInstanceOf[F] + g.asInstanceOf[Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21))).asInstanceOf[F] ) def tupledFunction22[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( - tupledImpl = (f: F) => f.asInstanceOf[Function22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]].tupled.asInstanceOf[G], + tupledImpl = (f: F) => f.asInstanceOf[Function22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]].tupled.asInstanceOf[G], untupledImpl = (g: G) => ((x1: Any, x2: Any, x3: Any, x4: Any, x5: Any, x6: Any, x7: Any, x8: Any, x9: Any, x10: Any, x11: Any, x12: Any, x13: Any, x14: Any, x15: Any, x16: Any, x17: Any, x18: Any, x19: Any, x20: Any, x21: Any, x22: Any) => - g.asInstanceOf[Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22))).asInstanceOf[F] + g.asInstanceOf[Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Any].apply((x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22))).asInstanceOf[F] ) def tupledFunctionXXL[F, G]: TupledFunction[F, G] = TupledFunction[F, G]( diff --git a/library/src/scala/IArray.scala b/library/src/scala/IArray.scala index 72124bdf8215..e284c2e35c2f 100644 --- a/library/src/scala/IArray.scala +++ b/library/src/scala/IArray.scala @@ -5,7 +5,7 @@ import scala.collection.{LazyZip2, SeqView, Searching, Stepper, StepperShape} import scala.collection.immutable.ArraySeq import scala.collection.mutable.{ArrayBuilder, Builder} -opaque type IArray[+T] = Array[_ <: T] +opaque type IArray[+T] = Array[? <: T] /** An immutable array. An `IArray[T]` has the same representation as an `Array[T]`, * but it cannot be updated. Unlike regular arrays, immutable arrays are covariant. @@ -298,10 +298,10 @@ object IArray: def search[U >: T](elem: U)(using Ordering[U]): Searching.SearchResult = arr.toSeq.search(elem) def search[U >: T](elem: U, from: Int, to: Int)(using Ordering[U]): Searching.SearchResult = arr.toSeq.search(elem, from, to) def sizeCompare(that: IArray[Any]): Int = arr.toSeq.sizeCompare(that) - def sizeCompare(that: Iterable[_]): Int = arr.toSeq.sizeCompare(that) + def sizeCompare(that: Iterable[?]): Int = arr.toSeq.sizeCompare(that) def sizeCompare(otherSize: Int): Int = genericArrayOps(arr).sizeCompare(otherSize) def sliding(size: Int, step: Int = 1): Iterator[IArray[T]] = genericArrayOps(arr).sliding(size, step) - def stepper[S <: Stepper[_]](using StepperShape[T, S]): S = genericArrayOps(arr).stepper[S] + def stepper[S <: Stepper[?]](using StepperShape[T, S]): S = genericArrayOps(arr).stepper[S] def tails: Iterator[IArray[T]] = genericArrayOps(arr).tails def tapEach[U](f: (T) => U): IArray[T] = arr.toSeq.foreach(f) @@ -615,7 +615,7 @@ object IArray: * @param x the selector value * @return sequence wrapped in a [[scala.Some]], if `x` is a Seq, otherwise `None` */ - def unapplySeq[T](x: IArray[T]): Array.UnapplySeqWrapper[_ <: T] = + def unapplySeq[T](x: IArray[T]): Array.UnapplySeqWrapper[? <: T] = Array.unapplySeq(x) /** A lazy filtered array. No filtering is applied until one of `foreach`, `map` or `flatMap` is called. */ diff --git a/library/src/scala/Tuple.scala b/library/src/scala/Tuple.scala index 2d9aaea2be08..3f315d26458f 100644 --- a/library/src/scala/Tuple.scala +++ b/library/src/scala/Tuple.scala @@ -97,25 +97,25 @@ object Tuple { /** Type of the head of a tuple */ type Head[X <: NonEmptyTuple] = X match { - case x *: _ => x + case x *: xs => x } /** Type of the initial part of the tuple without its last element */ type Init[X <: Tuple] <: Tuple = X match { - case _ *: EmptyTuple => EmptyTuple + case x *: EmptyTuple => EmptyTuple case x *: xs => x *: Init[xs] } /** Type of the tail of a tuple */ type Tail[X <: NonEmptyTuple] <: Tuple = X match { - case _ *: xs => xs + case x *: xs => xs } /** Type of the last element of a tuple */ type Last[X <: Tuple] = X match { case x *: EmptyTuple => x - case _ *: xs => Last[xs] + case x *: xs => Last[xs] } /** Type of the concatenation of two tuples */ @@ -182,8 +182,8 @@ object Tuple { */ type Zip[T1 <: Tuple, T2 <: Tuple] <: Tuple = (T1, T2) match { case (h1 *: t1, h2 *: t2) => (h1, h2) *: Zip[t1, t2] - case (EmptyTuple, _) => EmptyTuple - case (_, EmptyTuple) => EmptyTuple + case (EmptyTuple, ?) => EmptyTuple + case (?, EmptyTuple) => EmptyTuple case _ => Tuple } diff --git a/library/src/scala/reflect/Selectable.scala b/library/src/scala/reflect/Selectable.scala index f0bc1f197f5d..183571c35aa7 100644 --- a/library/src/scala/reflect/Selectable.scala +++ b/library/src/scala/reflect/Selectable.scala @@ -33,7 +33,7 @@ trait Selectable extends scala.Selectable: * @param paramTypes The class tags of the selected method's formal parameter types * @param args The arguments to pass to the selected method */ - final def applyDynamic(name: String, paramTypes: Class[_]*)(args: Any*): Any = + final def applyDynamic(name: String, paramTypes: Class[?]*)(args: Any*): Any = val rcls = selectedValue.getClass val mth = rcls.getMethod(name, paramTypes: _*).nn ensureAccessible(mth) diff --git a/library/src/scala/runtime/Arrays.scala b/library/src/scala/runtime/Arrays.scala index 2d98caea4df8..96a26aad2486 100644 --- a/library/src/scala/runtime/Arrays.scala +++ b/library/src/scala/runtime/Arrays.scala @@ -18,7 +18,7 @@ object Arrays { tag.newArray(length) /** Convert a sequence to a Java array with element type given by `clazz`. */ - def seqToArray[T](xs: Seq[T], clazz: Class[_]): Array[T] = { + def seqToArray[T](xs: Seq[T], clazz: Class[?]): Array[T] = { val arr = java.lang.reflect.Array.newInstance(clazz, xs.length).asInstanceOf[Array[T]] xs.copyToArray(arr) arr @@ -26,6 +26,6 @@ object Arrays { /** Create an array of a reference type T. */ - def newArray[Arr](componentType: Class[_], returnType: Class[Arr], dimensions: Array[Int]): Arr = + def newArray[Arr](componentType: Class[?], returnType: Class[Arr], dimensions: Array[Int]): Arr = jlr.Array.newInstance(componentType, dimensions: _*).asInstanceOf[Arr] } diff --git a/library/src/scala/runtime/LazyVals.scala b/library/src/scala/runtime/LazyVals.scala index 0edbe0e748f4..080751af9464 100644 --- a/library/src/scala/runtime/LazyVals.scala +++ b/library/src/scala/runtime/LazyVals.scala @@ -135,7 +135,7 @@ object LazyVals { } // kept for backward compatibility - def getOffset(clz: Class[_], name: String): Long = { + def getOffset(clz: Class[?], name: String): Long = { @nowarn val r = unsafe.objectFieldOffset(clz.getDeclaredField(name)) if (debug) diff --git a/library/src/scala/runtime/Tuples.scala b/library/src/scala/runtime/Tuples.scala index 87682ed86ce5..41425e8559ba 100644 --- a/library/src/scala/runtime/Tuples.scala +++ b/library/src/scala/runtime/Tuples.scala @@ -63,112 +63,112 @@ object Tuples { case 0 => EmptyTuple case 1 => xs match { - case xs: Tuple1[_] => xs + case xs: Tuple1[?] => xs case xs => Tuple1(xs.productElement(0)) } case 2 => xs match { - case xs: Tuple2[_, _] => xs + case xs: Tuple2[?, ?] => xs case xs => Tuple2(xs.productElement(0), xs.productElement(1)) } case 3 => xs match { - case xs: Tuple3[_, _, _] => xs + case xs: Tuple3[?, ?, ?] => xs case xs => Tuple3(xs.productElement(0), xs.productElement(1), xs.productElement(2)) } case 4 => xs match { - case xs: Tuple4[_, _, _, _] => xs + case xs: Tuple4[?, ?, ?, ?] => xs case xs => Tuple4(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3)) } case 5 => xs match { - case xs: Tuple5[_, _, _, _, _] => xs + case xs: Tuple5[?, ?, ?, ?, ?] => xs case xs => Tuple5(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4)) } case 6 => xs match { - case xs: Tuple6[_, _, _, _, _, _] => xs + case xs: Tuple6[?, ?, ?, ?, ?, ?] => xs case xs => Tuple6(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5)) } case 7 => xs match { - case xs: Tuple7[_, _, _, _, _, _, _] => xs + case xs: Tuple7[?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple7(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6)) } case 8 => xs match { - case xs: Tuple8[_, _, _, _, _, _, _, _] => xs + case xs: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple8(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7)) } case 9 => xs match { - case xs: Tuple9[_, _, _, _, _, _, _, _, _] => xs + case xs: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple9(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8)) } case 10 => xs match { - case xs: Tuple10[_, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple10(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9)) } case 11 => xs match { - case xs: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple11(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10)) } case 12 => xs match { - case xs: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple12(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11)) } case 13 => xs match { - case xs: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple13(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12)) } case 14 => xs match { - case xs: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple14(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13)) } case 15 => xs match { - case xs: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple15(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14)) } case 16 => xs match { - case xs: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple16(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15)) } case 17 => xs match { - case xs: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple17(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16)) } case 18 => xs match { - case xs: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple18(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16), xs.productElement(17)) } case 19 => xs match { - case xs: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple19(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16), xs.productElement(17), xs.productElement(18)) } case 20 => xs match { - case xs: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple20(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16), xs.productElement(17), xs.productElement(18), xs.productElement(19)) } case 21 => xs match { - case xs: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple21(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16), xs.productElement(17), xs.productElement(18), xs.productElement(19), xs.productElement(20)) } case 22 => xs match { - case xs: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => xs + case xs: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => xs case xs => Tuple22(xs.productElement(0), xs.productElement(1), xs.productElement(2), xs.productElement(3), xs.productElement(4), xs.productElement(5), xs.productElement(6), xs.productElement(7), xs.productElement(8), xs.productElement(9), xs.productElement(10), xs.productElement(11), xs.productElement(12), xs.productElement(13), xs.productElement(14), xs.productElement(15), xs.productElement(16), xs.productElement(17), xs.productElement(18), xs.productElement(19), xs.productElement(20), xs.productElement(21)) } case _ => @@ -183,49 +183,49 @@ object Tuples { (self: Any) match { case EmptyTuple => Tuple1(x) - case self: Tuple1[_] => + case self: Tuple1[?] => Tuple2(x, self._1) - case self: Tuple2[_, _] => + case self: Tuple2[?, ?] => Tuple3(x, self._1, self._2) - case self: Tuple3[_, _, _] => + case self: Tuple3[?, ?, ?] => Tuple4(x, self._1, self._2, self._3) - case self: Tuple4[_, _, _, _] => + case self: Tuple4[?, ?, ?, ?] => Tuple5(x, self._1, self._2, self._3, self._4) - case self: Tuple5[_, _, _, _, _] => + case self: Tuple5[?, ?, ?, ?, ?] => Tuple6(x, self._1, self._2, self._3, self._4, self._5) - case self: Tuple6[_, _, _, _, _, _] => + case self: Tuple6[?, ?, ?, ?, ?, ?] => Tuple7(x, self._1, self._2, self._3, self._4, self._5, self._6) - case self: Tuple7[_, _, _, _, _, _, _] => + case self: Tuple7[?, ?, ?, ?, ?, ?, ?] => Tuple8(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7) - case self: Tuple8[_, _, _, _, _, _, _, _] => + case self: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Tuple9(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8) - case self: Tuple9[_, _, _, _, _, _, _, _, _] => + case self: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple10(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9) - case self: Tuple10[_, _, _, _, _, _, _, _, _, _] => + case self: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple11(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10) - case self: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple12(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11) - case self: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple13(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12) - case self: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple14(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13) - case self: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple15(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14) - case self: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple16(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15) - case self: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple17(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16) - case self: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple18(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17) - case self: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple19(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18) - case self: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple20(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19) - case self: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple21(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20) - case self: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple22(x, self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, self._21) - case self: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => val arr: Array[Object] = Array( x.asInstanceOf[Object], self._1.asInstanceOf[Object], self._2.asInstanceOf[Object], self._3.asInstanceOf[Object], self._4.asInstanceOf[Object], self._5.asInstanceOf[Object], @@ -288,49 +288,49 @@ object Tuples { // Tail for Tuple1 to Tuple22 private def specialCaseTail(self: Tuple): Tuple = { (self: Any) match { - case self: Tuple1[_] => + case self: Tuple1[?] => EmptyTuple - case self: Tuple2[_, _] => + case self: Tuple2[?, ?] => Tuple1(self._2) - case self: Tuple3[_, _, _] => + case self: Tuple3[?, ?, ?] => Tuple2(self._2, self._3) - case self: Tuple4[_, _, _, _] => + case self: Tuple4[?, ?, ?, ?] => Tuple3(self._2, self._3, self._4) - case self: Tuple5[_, _, _, _, _] => + case self: Tuple5[?, ?, ?, ?, ?] => Tuple4(self._2, self._3, self._4, self._5) - case self: Tuple6[_, _, _, _, _, _] => + case self: Tuple6[?, ?, ?, ?, ?, ?] => Tuple5(self._2, self._3, self._4, self._5, self._6) - case self: Tuple7[_, _, _, _, _, _, _] => + case self: Tuple7[?, ?, ?, ?, ?, ?, ?] => Tuple6(self._2, self._3, self._4, self._5, self._6, self._7) - case self: Tuple8[_, _, _, _, _, _, _, _] => + case self: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Tuple7(self._2, self._3, self._4, self._5, self._6, self._7, self._8) - case self: Tuple9[_, _, _, _, _, _, _, _, _] => + case self: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple8(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9) - case self: Tuple10[_, _, _, _, _, _, _, _, _, _] => + case self: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple9(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10) - case self: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple10(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11) - case self: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple11(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12) - case self: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple12(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13) - case self: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple13(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14) - case self: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple14(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15) - case self: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple15(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16) - case self: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple16(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17) - case self: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple17(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18) - case self: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple18(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19) - case self: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple19(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20) - case self: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple20(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, self._21) - case self: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple21(self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, self._21, self._22) } } @@ -370,49 +370,49 @@ object Tuples { (self: Any) match { case EmptyTuple => Tuple1(x) - case self: Tuple1[_] => + case self: Tuple1[?] => Tuple2(self._1, x) - case self: Tuple2[_, _] => + case self: Tuple2[?, ?] => Tuple3(self._1, self._2, x) - case self: Tuple3[_, _, _] => + case self: Tuple3[?, ?, ?] => Tuple4(self._1, self._2, self._3, x) - case self: Tuple4[_, _, _, _] => + case self: Tuple4[?, ?, ?, ?] => Tuple5(self._1, self._2, self._3, self._4, x) - case self: Tuple5[_, _, _, _, _] => + case self: Tuple5[?, ?, ?, ?, ?] => Tuple6(self._1, self._2, self._3, self._4, self._5, x) - case self: Tuple6[_, _, _, _, _, _] => + case self: Tuple6[?, ?, ?, ?, ?, ?] => Tuple7(self._1, self._2, self._3, self._4, self._5, self._6, x) - case self: Tuple7[_, _, _, _, _, _, _] => + case self: Tuple7[?, ?, ?, ?, ?, ?, ?] => Tuple8(self._1, self._2, self._3, self._4, self._5, self._6, self._7, x) - case self: Tuple8[_, _, _, _, _, _, _, _] => + case self: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Tuple9(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, x) - case self: Tuple9[_, _, _, _, _, _, _, _, _] => + case self: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple10(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, x) - case self: Tuple10[_, _, _, _, _, _, _, _, _, _] => + case self: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple11(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, x) - case self: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple12(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, x) - case self: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple13(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, x) - case self: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple14(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, x) - case self: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple15(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, x) - case self: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple16(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, x) - case self: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple17(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, x) - case self: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple18(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, x) - case self: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple19(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, x) - case self: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple20(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, x) - case self: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple21(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, x) - case self: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple22(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, self._21, x) - case self: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => val arr: Array[Object] = Array( self._1.asInstanceOf[Object], self._2.asInstanceOf[Object], self._3.asInstanceOf[Object], self._4.asInstanceOf[Object], self._5.asInstanceOf[Object], @@ -458,49 +458,49 @@ object Tuples { (self: Any) match { case EmptyTuple => EmptyTuple - case self: Tuple1[_] => + case self: Tuple1[?] => self - case self: Tuple2[_, _] => + case self: Tuple2[?, ?] => Tuple2(self._2, self._1) - case self: Tuple3[_, _, _] => + case self: Tuple3[?, ?, ?] => Tuple3(self._3, self._2, self._1) - case self: Tuple4[_, _, _, _] => + case self: Tuple4[?, ?, ?, ?] => Tuple4(self._4, self._3, self._2, self._1) - case self: Tuple5[_, _, _, _, _] => + case self: Tuple5[?, ?, ?, ?, ?] => Tuple5(self._5, self._4, self._3, self._2, self._1) - case self: Tuple6[_, _, _, _, _, _] => + case self: Tuple6[?, ?, ?, ?, ?, ?] => Tuple6(self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple7[_, _, _, _, _, _, _] => + case self: Tuple7[?, ?, ?, ?, ?, ?, ?] => Tuple7(self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple8[_, _, _, _, _, _, _, _] => + case self: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Tuple8(self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple9[_, _, _, _, _, _, _, _, _] => + case self: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple9(self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple10[_, _, _, _, _, _, _, _, _, _] => + case self: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple10(self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple11(self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple12(self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple13(self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple14(self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple15(self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple16(self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple17(self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple18(self._18, self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple19(self._19, self._18, self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple20(self._20, self._19, self._18, self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple21(self._21, self._20, self._19, self._18, self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) - case self: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple22(self._22, self._21, self._20, self._19, self._18, self._17, self._16, self._15, self._14, self._13, self._12, self._11, self._10, self._9, self._8, self._7, self._6, self._5, self._4, self._3, self._2, self._1) } } @@ -514,49 +514,49 @@ object Tuples { // Init for Tuple1 to Tuple22 private def specialCaseInit(self: Tuple): Tuple = { (self: Any) match { - case _: Tuple1[_] => + case _: Tuple1[?] => EmptyTuple - case self: Tuple2[_, _] => + case self: Tuple2[?, ?] => Tuple1(self._1) - case self: Tuple3[_, _, _] => + case self: Tuple3[?, ?, ?] => Tuple2(self._1, self._2) - case self: Tuple4[_, _, _, _] => + case self: Tuple4[?, ?, ?, ?] => Tuple3(self._1, self._2, self._3) - case self: Tuple5[_, _, _, _, _] => + case self: Tuple5[?, ?, ?, ?, ?] => Tuple4(self._1,self._2, self._3, self._4) - case self: Tuple6[_, _, _, _, _, _] => + case self: Tuple6[?, ?, ?, ?, ?, ?] => Tuple5(self._1, self._2, self._3, self._4, self._5) - case self: Tuple7[_, _, _, _, _, _, _] => + case self: Tuple7[?, ?, ?, ?, ?, ?, ?] => Tuple6(self._1, self._2, self._3, self._4, self._5, self._6) - case self: Tuple8[_, _, _, _, _, _, _, _] => + case self: Tuple8[?, ?, ?, ?, ?, ?, ?, ?] => Tuple7(self._1, self._2, self._3, self._4, self._5, self._6, self._7) - case self: Tuple9[_, _, _, _, _, _, _, _, _] => + case self: Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple8(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8) - case self: Tuple10[_, _, _, _, _, _, _, _, _, _] => + case self: Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple9(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9) - case self: Tuple11[_, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple10(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10) - case self: Tuple12[_, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple11(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11) - case self: Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple12(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12) - case self: Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple13(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13) - case self: Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple14(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14) - case self: Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple15(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15) - case self: Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple16(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16) - case self: Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple17(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17) - case self: Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple18(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18) - case self: Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple19(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19) - case self: Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple20(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20) - case self: Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _] => + case self: Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?] => Tuple21(self._1, self._2, self._3, self._4, self._5, self._6, self._7, self._8, self._9, self._10, self._11, self._12, self._13, self._14, self._15, self._16, self._17, self._18, self._19, self._20, self._21) } } @@ -680,28 +680,28 @@ object Tuples { case x: Product => x.productArity match case 0 => x == EmptyTuple - case 1 => x.isInstanceOf[Tuple1[_]] - case 2 => x.isInstanceOf[Tuple2[_, _]] - case 3 => x.isInstanceOf[Tuple3[_, _, _]] - case 4 => x.isInstanceOf[Tuple4[_, _, _, _]] - case 5 => x.isInstanceOf[Tuple5[_, _, _, _, _]] - case 6 => x.isInstanceOf[Tuple6[_, _, _, _, _, _]] - case 7 => x.isInstanceOf[Tuple7[_, _, _, _, _, _, _]] - case 8 => x.isInstanceOf[Tuple8[_, _, _, _, _, _, _, _]] - case 9 => x.isInstanceOf[Tuple9[_, _, _, _, _, _, _, _, _]] - case 10 => x.isInstanceOf[Tuple10[_, _, _, _, _, _, _, _, _, _]] - case 11 => x.isInstanceOf[Tuple11[_, _, _, _, _, _, _, _, _, _, _]] - case 12 => x.isInstanceOf[Tuple12[_, _, _, _, _, _, _, _, _, _, _, _]] - case 13 => x.isInstanceOf[Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _]] - case 14 => x.isInstanceOf[Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 15 => x.isInstanceOf[Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 16 => x.isInstanceOf[Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 17 => x.isInstanceOf[Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 18 => x.isInstanceOf[Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 19 => x.isInstanceOf[Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 20 => x.isInstanceOf[Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 21 => x.isInstanceOf[Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 22 => x.isInstanceOf[Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] + case 1 => x.isInstanceOf[Tuple1[?]] + case 2 => x.isInstanceOf[Tuple2[?, ?]] + case 3 => x.isInstanceOf[Tuple3[?, ?, ?]] + case 4 => x.isInstanceOf[Tuple4[?, ?, ?, ?]] + case 5 => x.isInstanceOf[Tuple5[?, ?, ?, ?, ?]] + case 6 => x.isInstanceOf[Tuple6[?, ?, ?, ?, ?, ?]] + case 7 => x.isInstanceOf[Tuple7[?, ?, ?, ?, ?, ?, ?]] + case 8 => x.isInstanceOf[Tuple8[?, ?, ?, ?, ?, ?, ?, ?]] + case 9 => x.isInstanceOf[Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 10 => x.isInstanceOf[Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 11 => x.isInstanceOf[Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 12 => x.isInstanceOf[Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 13 => x.isInstanceOf[Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 14 => x.isInstanceOf[Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 15 => x.isInstanceOf[Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 16 => x.isInstanceOf[Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 17 => x.isInstanceOf[Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 18 => x.isInstanceOf[Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 19 => x.isInstanceOf[Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 20 => x.isInstanceOf[Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 21 => x.isInstanceOf[Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 22 => x.isInstanceOf[Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] case _ => x.isInstanceOf[TupleXXL] case _ => false @@ -712,28 +712,28 @@ object Tuples { x match case x: Product => x.productArity match - case 1 => x.isInstanceOf[Tuple1[_]] - case 2 => x.isInstanceOf[Tuple2[_, _]] - case 3 => x.isInstanceOf[Tuple3[_, _, _]] - case 4 => x.isInstanceOf[Tuple4[_, _, _, _]] - case 5 => x.isInstanceOf[Tuple5[_, _, _, _, _]] - case 6 => x.isInstanceOf[Tuple6[_, _, _, _, _, _]] - case 7 => x.isInstanceOf[Tuple7[_, _, _, _, _, _, _]] - case 8 => x.isInstanceOf[Tuple8[_, _, _, _, _, _, _, _]] - case 9 => x.isInstanceOf[Tuple9[_, _, _, _, _, _, _, _, _]] - case 10 => x.isInstanceOf[Tuple10[_, _, _, _, _, _, _, _, _, _]] - case 11 => x.isInstanceOf[Tuple11[_, _, _, _, _, _, _, _, _, _, _]] - case 12 => x.isInstanceOf[Tuple12[_, _, _, _, _, _, _, _, _, _, _, _]] - case 13 => x.isInstanceOf[Tuple13[_, _, _, _, _, _, _, _, _, _, _, _, _]] - case 14 => x.isInstanceOf[Tuple14[_, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 15 => x.isInstanceOf[Tuple15[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 16 => x.isInstanceOf[Tuple16[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 17 => x.isInstanceOf[Tuple17[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 18 => x.isInstanceOf[Tuple18[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 19 => x.isInstanceOf[Tuple19[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 20 => x.isInstanceOf[Tuple20[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 21 => x.isInstanceOf[Tuple21[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] - case 22 => x.isInstanceOf[Tuple22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] + case 1 => x.isInstanceOf[Tuple1[?]] + case 2 => x.isInstanceOf[Tuple2[?, ?]] + case 3 => x.isInstanceOf[Tuple3[?, ?, ?]] + case 4 => x.isInstanceOf[Tuple4[?, ?, ?, ?]] + case 5 => x.isInstanceOf[Tuple5[?, ?, ?, ?, ?]] + case 6 => x.isInstanceOf[Tuple6[?, ?, ?, ?, ?, ?]] + case 7 => x.isInstanceOf[Tuple7[?, ?, ?, ?, ?, ?, ?]] + case 8 => x.isInstanceOf[Tuple8[?, ?, ?, ?, ?, ?, ?, ?]] + case 9 => x.isInstanceOf[Tuple9[?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 10 => x.isInstanceOf[Tuple10[?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 11 => x.isInstanceOf[Tuple11[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 12 => x.isInstanceOf[Tuple12[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 13 => x.isInstanceOf[Tuple13[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 14 => x.isInstanceOf[Tuple14[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 15 => x.isInstanceOf[Tuple15[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 16 => x.isInstanceOf[Tuple16[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 17 => x.isInstanceOf[Tuple17[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 18 => x.isInstanceOf[Tuple18[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 19 => x.isInstanceOf[Tuple19[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 20 => x.isInstanceOf[Tuple20[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 21 => x.isInstanceOf[Tuple21[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] + case 22 => x.isInstanceOf[Tuple22[?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]] case _ => x.isInstanceOf[TupleXXL] case _ => false diff --git a/library/src/scala/runtime/stdLibPatches/language.scala b/library/src/scala/runtime/stdLibPatches/language.scala index fbab0c14c9fb..6e760b141d94 100644 --- a/library/src/scala/runtime/stdLibPatches/language.scala +++ b/library/src/scala/runtime/stdLibPatches/language.scala @@ -114,6 +114,10 @@ object language: */ @compileTimeOnly("`symbolLiterals` can only be used at compile time in import statements") object symbolLiterals + + /** TODO */ + @compileTimeOnly("`underscoreWildcards` can only be used at compile time in import statements") + object underscoreWildcards end deprecated /** Where imported, auto-tupling is disabled. diff --git a/project/Build.scala b/project/Build.scala index 13ebe9c028ae..77c8a8540c53 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1008,7 +1008,10 @@ object Build { Seq("-sourcepath", ((Compile/sourceManaged).value / "scala-library-src").toString) }, Compile / doc / scalacOptions += "-Ydocument-synthetic-types", - scalacOptions += "-Ycompile-scala2-library", + scalacOptions ++= Seq( + "-Ycompile-scala2-library", + "-language:deprecated.underscoreWildcards", + ), scalacOptions -= "-Xfatal-warnings", ivyConfigurations += SourceDeps.hide, transitiveClassifiers := Seq("sources"), @@ -1292,6 +1295,7 @@ object Build { mtagsSharedSources } (Set(mtagsSharedSourceJar)).toSeq }.taskValue, + scalacOptions += "-language:deprecated.underscoreWildcards", ) } diff --git a/scaladoc-testcases/src/tests/exports1.scala b/scaladoc-testcases/src/tests/exports1.scala index 542880b3a590..f719bca35eb1 100644 --- a/scaladoc-testcases/src/tests/exports1.scala +++ b/scaladoc-testcases/src/tests/exports1.scala @@ -16,7 +16,7 @@ class A: //unexpected = 1 type HKT[T[_], X] //expected: final type HKT = [T[_], X] =>> a.HKT[T, X] = T[X] - type SomeRandomType = (List[_] | Seq[_]) & String //expected: final type SomeRandomType = a.SomeRandomType + type SomeRandomType = (List[?] | Seq[?]) & String //expected: final type SomeRandomType = a.SomeRandomType def x[T[_], X](x: X): HKT[T, X] //expected: def x[T[_], X](x: X): A.this.HKT[T, X] = ??? def fn[T, U]: T => U diff --git a/scaladoc-testcases/src/tests/hkts.scala b/scaladoc-testcases/src/tests/hkts.scala index d8e29d993821..c04fcf1e0cd1 100644 --- a/scaladoc-testcases/src/tests/hkts.scala +++ b/scaladoc-testcases/src/tests/hkts.scala @@ -46,7 +46,7 @@ trait Case14[C[_]] class SomeClass extends Case14[List] -def method1[E, T](value: List[_ >: E]): Int = 0 +def method1[E, T](value: List[? >: E]): Int = 0 def method2[F[+X] <: Option[X], A](fa: F[A]): A = fa.get import scala.collection.immutable.ArraySeq diff --git a/scaladoc-testcases/src/tests/snippetTestcase2.scala b/scaladoc-testcases/src/tests/snippetTestcase2.scala index c85207b46f59..6a26767efa86 100644 --- a/scaladoc-testcases/src/tests/snippetTestcase2.scala +++ b/scaladoc-testcases/src/tests/snippetTestcase2.scala @@ -2,7 +2,7 @@ package tests package snippetTestcase2 trait Quotes2[A] { - val r1: r1Module[_] = ??? + val r1: r1Module[?] = ??? trait r1Module[A] { type X object Y { diff --git a/scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala b/scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala index 57c2b2910d6a..403acb19305d 100644 --- a/scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala +++ b/scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala @@ -133,5 +133,5 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings: "List of quick links that is displayed in the header of documentation." ) - def scaladocSpecificSettings: Set[Setting[_]] = + def scaladocSpecificSettings: Set[Setting[?]] = Set(sourceLinks, legacySourceLink, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, generateInkuire, defaultTemplate, scastieConfiguration, quickLinks) diff --git a/scaladoc/src/dotty/tools/scaladoc/site/StaticSiteLoader.scala b/scaladoc/src/dotty/tools/scaladoc/site/StaticSiteLoader.scala index 489720cc5936..e25639c36183 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/StaticSiteLoader.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/StaticSiteLoader.scala @@ -144,7 +144,7 @@ class StaticSiteLoader(val root: File, val args: Scaladoc.Args)(using StaticSite (("1900","01","01"), name) def dateFrom(tf: TemplateFile, default: String = "1900-01-01"): String = - val pageSettings = tf.settings.get("page").collect{ case m: Map[String @unchecked, _] => m } + val pageSettings = tf.settings.get("page").collect{ case m: Map[String @unchecked, ?] => m } pageSettings.flatMap(_.get("date").collect{ case s: String => s}).getOrElse(default) // blogs without date are last val posts = List(rootPath.resolve("_posts")) diff --git a/scaladoc/src/dotty/tools/scaladoc/site/common.scala b/scaladoc/src/dotty/tools/scaladoc/site/common.scala index 0811d217537f..9e58dbe3cd28 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/common.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/common.scala @@ -94,7 +94,7 @@ def loadTemplateFile(file: File, defaultTitle: Option[TemplateName] = None)(usin }.map(_.stripPrefix("\"").stripSuffix("\"")) def listSetting(settings: Map[String, Object], name: String): Option[List[String]] = settings.get(name).map { - case elems: List[_] => elems.zipWithIndex.map { + case elems: List[?] => elems.zipWithIndex.map { case (s: String, _) => s case (other, index) => throw new RuntimeException(s"Expected a string at index $index for $name in $file but got $other") diff --git a/scaladoc/src/dotty/tools/scaladoc/site/templates.scala b/scaladoc/src/dotty/tools/scaladoc/site/templates.scala index 92e0096e5af1..c37ff8fe0200 100644 --- a/scaladoc/src/dotty/tools/scaladoc/site/templates.scala +++ b/scaladoc/src/dotty/tools/scaladoc/site/templates.scala @@ -103,10 +103,10 @@ case class TemplateFile( ) def asJavaElement(o: Object): Object = o match - case m: Map[_, _] => m.transform { + case m: Map[?, ?] => m.transform { case (k: String, v: Object) => asJavaElement(v) }.asJava - case l: List[_] => l.map(x => asJavaElement(x.asInstanceOf[Object])).asJava + case l: List[?] => l.map(x => asJavaElement(x.asInstanceOf[Object])).asJava case other => other // Library requires mutable maps.. diff --git a/scaladoc/src/dotty/tools/scaladoc/snippets/SnippetCompiler.scala b/scaladoc/src/dotty/tools/scaladoc/snippets/SnippetCompiler.scala index 03fdd4e849ff..0ab5086e09d0 100644 --- a/scaladoc/src/dotty/tools/scaladoc/snippets/SnippetCompiler.scala +++ b/scaladoc/src/dotty/tools/scaladoc/snippets/SnippetCompiler.scala @@ -21,7 +21,7 @@ import dotty.tools.dotc.util.{ SourcePosition, NoSourcePosition, SourceFile, NoS import scala.util.{ Try, Success, Failure } class SnippetCompiler( - val snippetCompilerSettings: Seq[SnippetCompilerSetting[_]], + val snippetCompilerSettings: Seq[SnippetCompilerSetting[?]], target: AbstractFile = new VirtualDirectory("(memory)") ): object SnippetDriver extends Driver: diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/DocFlexmarkExtension.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/DocFlexmarkExtension.scala index d797eaed7fbf..d87a6692b99c 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/DocFlexmarkExtension.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/DocFlexmarkExtension.scala @@ -72,7 +72,7 @@ case class DocFlexmarkRenderer(renderLink: (DocLink, String) => String) html.raw(renderLink(node.target, node.body)) object Render extends NodeRenderer: - override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[_]] = + override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[?]] = JSet( new NodeRenderingHandler(classOf[DocLinkNode], Handler), ) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala index 41c1c9c0fa42..0acb1c02a69e 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SectionRenderingExtension.scala @@ -59,7 +59,7 @@ object SectionRenderingExtension extends HtmlRenderer.HtmlRendererExtension: object Render extends NodeRenderer: - override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[_]] = + override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[?]] = JSet( new NodeRenderingHandler(classOf[Section], SectionHandler), new NodeRenderingHandler(classOf[AnchorLink], AnchorLinkHandler) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SnippetRenderingExtension.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SnippetRenderingExtension.scala index e980c5fc44ef..d4a439042073 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SnippetRenderingExtension.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/markdown/SnippetRenderingExtension.scala @@ -35,7 +35,7 @@ object SnippetRenderingExtension extends HtmlRenderer.HtmlRendererExtension: html.raw(SnippetRenderer.renderSnippet(node.getContentChars.toString, node.getInfo.toString.split(" ").headOption)) object Render extends NodeRenderer: - override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[_]] = + override def getNodeRenderingHandlers: JSet[NodeRenderingHandler[?]] = JSet( new NodeRenderingHandler(classOf[ExtendedFencedCodeBlock], ExtendedFencedCodeBlockHandler), new NodeRenderingHandler(classOf[FencedCodeBlock], FencedCodeBlockHandler) diff --git a/staging/src/scala/quoted/staging/ExprCompilationUnit.scala b/staging/src/scala/quoted/staging/ExprCompilationUnit.scala index 6f95c252fd9d..ea1456527c8b 100644 --- a/staging/src/scala/quoted/staging/ExprCompilationUnit.scala +++ b/staging/src/scala/quoted/staging/ExprCompilationUnit.scala @@ -5,4 +5,4 @@ import dotty.tools.dotc.CompilationUnit import dotty.tools.dotc.util.NoSource /** Compilation unit containing the contents of a quoted expression */ -private class ExprCompilationUnit(val exprBuilder: Quotes => Expr[_]) extends CompilationUnit(NoSource) +private class ExprCompilationUnit(val exprBuilder: Quotes => Expr[?]) extends CompilationUnit(NoSource) diff --git a/staging/src/scala/quoted/staging/QuoteCompiler.scala b/staging/src/scala/quoted/staging/QuoteCompiler.scala index eee2dacdc5f5..3b2432d4f47b 100644 --- a/staging/src/scala/quoted/staging/QuoteCompiler.scala +++ b/staging/src/scala/quoted/staging/QuoteCompiler.scala @@ -113,7 +113,7 @@ private class QuoteCompiler extends Compiler: /** Unpickle and optionally compile the expression. * Returns either `Left` with name of the classfile generated or `Right` with the value contained in the expression. */ - def compileExpr(exprBuilder: Quotes => Expr[_]): Either[String, Any] = + def compileExpr(exprBuilder: Quotes => Expr[?]): Either[String, Any] = val units = new ExprCompilationUnit(exprBuilder) :: Nil compileUnits(units) result diff --git a/tests/bench/inductive-implicits.scala b/tests/bench/inductive-implicits.scala index 58714214ce33..68027ac58d66 100644 --- a/tests/bench/inductive-implicits.scala +++ b/tests/bench/inductive-implicits.scala @@ -25,7 +25,7 @@ package shapeless { def ::[HH](h : HH) : HH :: H :: T = shapeless.::(h, this) override def toString = head match { - case _: ::[_, _] => "("+head.toString+") :: "+tail.toString + case _: ::[?, ?] => "("+head.toString+") :: "+tail.toString case _ => head.toString+" :: "+tail.toString } } diff --git a/tests/explicit-nulls/pos/array.scala b/tests/explicit-nulls/pos/array.scala index 7b188356f921..fd366fded79c 100644 --- a/tests/explicit-nulls/pos/array.scala +++ b/tests/explicit-nulls/pos/array.scala @@ -5,7 +5,7 @@ class Foo { def test = { // accept any array of string - def f(xs: Array[_ >: String <: String | Null] | Null): Unit = ??? + def f(xs: Array[? >: String <: String | Null] | Null): Unit = ??? val a1: Array[String] = ??? val a2: Array[String] | Null = ??? diff --git a/tests/explicit-nulls/pos/flow-inline.scala b/tests/explicit-nulls/pos/flow-inline.scala index e64258ba988f..29f2bffe14f2 100644 --- a/tests/explicit-nulls/pos/flow-inline.scala +++ b/tests/explicit-nulls/pos/flow-inline.scala @@ -7,8 +7,8 @@ class TreeOps { abstract class Tree[A, B](val key: A, val value: B) class RedTree[A, B](override val key: A, override val value: B) extends Tree[A, B](key, value) - private transparent inline def isRedTree(tree: Tree[_, _] | Null) = - (tree != null) && tree.isInstanceOf[RedTree[_, _]] + private transparent inline def isRedTree(tree: Tree[?, ?] | Null) = + (tree != null) && tree.isInstanceOf[RedTree[?, ?]] def foo[A, B](tree: Tree[A, B] | Null): Unit = { if (isRedTree(tree)) { diff --git a/tests/generic-java-signatures/arrayBound.scala b/tests/generic-java-signatures/arrayBound.scala index 928e1e55f1ed..78aff632e1b2 100644 --- a/tests/generic-java-signatures/arrayBound.scala +++ b/tests/generic-java-signatures/arrayBound.scala @@ -1,16 +1,16 @@ class Foo[ - T <: Array[_], + T <: Array[?], U <: Array[T], V <: java.util.List[Array[T]], - W <: java.util.List[_ <: java.util.Date], - X <: java.util.HashMap[Array[_], java.util.ArrayList[_ <: java.util.Date]], + W <: java.util.List[? <: java.util.Date], + X <: java.util.HashMap[Array[?], java.util.ArrayList[? <: java.util.Date]], T1, U1 <: Array[T1], V1 <: Array[Array[T1]] ] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _, _, _, _, _, _, _]].getTypeParameters() + val tParams = classOf[Foo[?, ?, ?, ?, ?, ?, ?, ?]].getTypeParameters() tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/boundParameters.scala b/tests/generic-java-signatures/boundParameters.scala index aa80e62d6cb2..8a33d91087fd 100644 --- a/tests/generic-java-signatures/boundParameters.scala +++ b/tests/generic-java-signatures/boundParameters.scala @@ -1,7 +1,7 @@ -class Foo[T <: java.util.List[_], U <: java.util.ArrayList[java.util.Date], V <: java.util.ArrayList[java.util.HashMap[java.util.HashSet[_], java.util.Calendar]]] +class Foo[T <: java.util.List[?], U <: java.util.ArrayList[java.util.Date], V <: java.util.ArrayList[java.util.HashMap[java.util.HashSet[?], java.util.Calendar]]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _, _]].getTypeParameters() + val tParams = classOf[Foo[?, ?, ?]].getTypeParameters() tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/boundsInterfaces.scala b/tests/generic-java-signatures/boundsInterfaces.scala index 2b0daaa5309a..8a613e316e9f 100644 --- a/tests/generic-java-signatures/boundsInterfaces.scala +++ b/tests/generic-java-signatures/boundsInterfaces.scala @@ -1,7 +1,7 @@ class Foo[T <: java.io.Serializable, U >: java.lang.Cloneable] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _]].getTypeParameters + val tParams = classOf[Foo[?, ?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/higherKinded.scala b/tests/generic-java-signatures/higherKinded.scala index 624f122676fe..fbe81fed4d25 100644 --- a/tests/generic-java-signatures/higherKinded.scala +++ b/tests/generic-java-signatures/higherKinded.scala @@ -3,7 +3,7 @@ import scala.language.higherKinds class Foo[t[x], u[y] <: java.util.List[y], v[z[a] <: Array[a]], b[B] <: java.util.List[B], w[b[c]] <: java.util.HashMap[Array[Int], b[java.util.Date]]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _, _, _, _]].getTypeParameters + val tParams = classOf[Foo[?, ?, ?, ?, ?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/i3476.scala b/tests/generic-java-signatures/i3476.scala index 4af0b77b98a5..370c6f35f8ba 100644 --- a/tests/generic-java-signatures/i3476.scala +++ b/tests/generic-java-signatures/i3476.scala @@ -1,16 +1,16 @@ object Test { - def hasGenericSignature(cls: Class[_], methName: String): Boolean = { + def hasGenericSignature(cls: Class[?], methName: String): Boolean = { cls.getDeclaredMethods().find(_.getName.contains(methName)) match { case None => throw new NoSuchMethodError(s"No $methName in ${cls.getName}") case Some(meth) => meth.getTypeParameters.nonEmpty } } - def checkHasGenericSignature(cls: Class[_], methName: String): Unit = + def checkHasGenericSignature(cls: Class[?], methName: String): Unit = assert(hasGenericSignature(cls, methName)) - def checkDoesntHaveGenericSignature(cls: Class[_], methName: String): Unit = + def checkDoesntHaveGenericSignature(cls: Class[?], methName: String): Unit = assert(!hasGenericSignature(cls, methName)) def main(args: Array[String]): Unit = { @@ -35,21 +35,21 @@ object Test { object TopLevelObject { def meth[T](x: T): T = x - def localObject: Class[_] = { + def localObject: Class[?] = { object LocalObject { def meth[T](x: T): T = x } LocalObject.getClass } - def localClass: Class[_] = { + def localClass: Class[?] = { class LocalClass { def meth[T](x: T): T = x } classOf[LocalClass] } - val otherLocalClass: Class[_] = { + val otherLocalClass: Class[?] = { class LocalClass { def meth[T](x: T): T = x } @@ -69,14 +69,14 @@ class TopLevelClass { def meth[T](x: T): T = x - def localClass: Class[_] = { + def localClass: Class[?] = { class LocalClass { def meth[T](x: T): T = x } classOf[LocalClass] } - val otherLocalClass: Class[_] = { + val otherLocalClass: Class[?] = { class LocalClass { def meth[T](x: T): T = x } diff --git a/tests/generic-java-signatures/lowerBoundClass.scala b/tests/generic-java-signatures/lowerBoundClass.scala index 44a0e9cf7f97..ae265d705269 100644 --- a/tests/generic-java-signatures/lowerBoundClass.scala +++ b/tests/generic-java-signatures/lowerBoundClass.scala @@ -1,7 +1,7 @@ class Foo[T <: java.util.Calendar, U >: java.util.Date] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _]].getTypeParameters + val tParams = classOf[Foo[?, ?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/mangledNames.scala b/tests/generic-java-signatures/mangledNames.scala index b57aff3d4018..86b27dd4d12c 100644 --- a/tests/generic-java-signatures/mangledNames.scala +++ b/tests/generic-java-signatures/mangledNames.scala @@ -2,7 +2,7 @@ class Foo[`!!!` <: java.util.Date] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_]].getTypeParameters() + val tParams = classOf[Foo[?]].getTypeParameters() tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/mangledNames2.scala b/tests/generic-java-signatures/mangledNames2.scala index 9dbf9da3bdb6..e1a7dc7cc1fb 100644 --- a/tests/generic-java-signatures/mangledNames2.scala +++ b/tests/generic-java-signatures/mangledNames2.scala @@ -2,7 +2,7 @@ class Foo[`![]:;!!` <: java.util.Date] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_]].getTypeParameters() + val tParams = classOf[Foo[?]].getTypeParameters() tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/primitiveArrayBound.scala b/tests/generic-java-signatures/primitiveArrayBound.scala index 21efdbb56c95..bc50aa2fd7d6 100644 --- a/tests/generic-java-signatures/primitiveArrayBound.scala +++ b/tests/generic-java-signatures/primitiveArrayBound.scala @@ -1,7 +1,7 @@ -class Foo[T <: Array[_ <: Int]] +class Foo[T <: Array[? <: Int]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_]].getTypeParameters + val tParams = classOf[Foo[?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/primitives.scala b/tests/generic-java-signatures/primitives.scala index 8f75309096fc..47a6d6978f6e 100644 --- a/tests/generic-java-signatures/primitives.scala +++ b/tests/generic-java-signatures/primitives.scala @@ -6,10 +6,10 @@ E <: Array[Int], F <: Array[Long], G <: Array[Short], H <: Array[Boolean], -I <: Array[_ <: Byte]] +I <: Array[? <: Byte]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _, _, _, _, _, _, _, _]].getTypeParameters + val tParams = classOf[Foo[?, ?, ?, ?, ?, ?, ?, ?, ?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds().map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/simple.scala b/tests/generic-java-signatures/simple.scala index b8c3be1bffd9..fff4cb9edccd 100644 --- a/tests/generic-java-signatures/simple.scala +++ b/tests/generic-java-signatures/simple.scala @@ -1,7 +1,7 @@ class Foo[T, U, LongerName] object Test { def main(args: Array[String]): Unit = { - val typeParams = classOf[Foo[_, _, _]].getTypeParameters + val typeParams = classOf[Foo[?, ?, ?]].getTypeParameters typeParams.foreach(tp => println(tp.getName)) } } \ No newline at end of file diff --git a/tests/generic-java-signatures/simpleBoundParameters.scala b/tests/generic-java-signatures/simpleBoundParameters.scala index beb99cba299a..f83d1882cf1f 100644 --- a/tests/generic-java-signatures/simpleBoundParameters.scala +++ b/tests/generic-java-signatures/simpleBoundParameters.scala @@ -1,7 +1,7 @@ -class Foo[T <: java.util.List[_]] +class Foo[T <: java.util.List[?]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_]].getTypeParameters() + val tParams = classOf[Foo[?]].getTypeParameters() tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/valueClassBound.scala b/tests/generic-java-signatures/valueClassBound.scala index 76711dd500a9..9d99640d4646 100644 --- a/tests/generic-java-signatures/valueClassBound.scala +++ b/tests/generic-java-signatures/valueClassBound.scala @@ -2,7 +2,7 @@ class VC(val x: Int) extends AnyVal class Foo[T <: VC] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_]].getTypeParameters + val tParams = classOf[Foo[?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds.map(_.getTypeName).mkString(", ")) } diff --git a/tests/generic-java-signatures/wildcards.scala b/tests/generic-java-signatures/wildcards.scala index ee7b71f5b612..38d971842fb4 100644 --- a/tests/generic-java-signatures/wildcards.scala +++ b/tests/generic-java-signatures/wildcards.scala @@ -1,7 +1,7 @@ -class Foo[T <: java.util.List[_ <: java.util.Calendar], U <: java.util.HashMap[java.util.List[_ <: T], java.util.Set[_ >: T]], V <: java.util.Queue[Int]] +class Foo[T <: java.util.List[? <: java.util.Calendar], U <: java.util.HashMap[java.util.List[? <: T], java.util.Set[? >: T]], V <: java.util.Queue[Int]] object Test { def main(args: Array[String]): Unit = { - val tParams = classOf[Foo[_, _, _]].getTypeParameters + val tParams = classOf[Foo[?, ?, ?]].getTypeParameters tParams.foreach { tp => println(tp.getName + " <: " + tp.getBounds().map(_.getTypeName).mkString(", ")) } diff --git a/tests/init/crash/rbtree.scala b/tests/init/crash/rbtree.scala index 6fa03938f5a3..2f71e431a233 100644 --- a/tests/init/crash/rbtree.scala +++ b/tests/init/crash/rbtree.scala @@ -27,9 +27,9 @@ import scala.annotation.meta.getter private[collection] object RedBlackTree { - def isEmpty(tree: Tree[_, _]): Boolean = tree eq null + def isEmpty(tree: Tree[?, ?]): Boolean = tree eq null - def contains[A: Ordering](tree: Tree[A, _], x: A): Boolean = lookup(tree, x) ne null + def contains[A: Ordering](tree: Tree[A, ?], x: A): Boolean = lookup(tree, x) ne null def get[A: Ordering, B](tree: Tree[A, B], x: A): Option[B] = lookup(tree, x) match { case null => None case tree => Some(tree.value) @@ -43,12 +43,12 @@ object RedBlackTree { else tree } - def count(tree: Tree[_, _]) = if (tree eq null) 0 else tree.count + def count(tree: Tree[?, ?]) = if (tree eq null) 0 else tree.count /** * Count all the nodes with keys greater than or equal to the lower bound and less than the upper bound. * The two bounds are optional. */ - def countInRange[A](tree: Tree[A, _], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = + def countInRange[A](tree: Tree[A, ?], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = if (tree eq null) 0 else (from, to) match { // with no bounds use this node's count @@ -102,16 +102,16 @@ object RedBlackTree { if (tree.right ne null) _foreach(tree.right, f) } - def foreachKey[A, U](tree:Tree[A,_], f: A => U):Unit = if (tree ne null) _foreachKey(tree,f) + def foreachKey[A, U](tree:Tree[A, ?], f: A => U):Unit = if (tree ne null) _foreachKey(tree,f) - private[this] def _foreachKey[A, U](tree: Tree[A, _], f: A => U): Unit = { + private[this] def _foreachKey[A, U](tree: Tree[A, ?], f: A => U): Unit = { if (tree.left ne null) _foreachKey(tree.left, f) f((tree.key)) if (tree.right ne null) _foreachKey(tree.right, f) } def iterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None): Iterator[(A, B)] = new EntriesIterator(tree, start) - def keysIterator[A: Ordering](tree: Tree[A, _], start: Option[A] = None): Iterator[A] = new KeysIterator(tree, start) + def keysIterator[A: Ordering](tree: Tree[A, ?], start: Option[A] = None): Iterator[A] = new KeysIterator(tree, start) def valuesIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None): Iterator[B] = new ValuesIterator(tree, start) @tailrec @@ -122,10 +122,10 @@ object RedBlackTree { else tree } - def isBlack(tree: Tree[_, _]) = (tree eq null) || isBlackTree(tree) + def isBlack(tree: Tree[?, ?]) = (tree eq null) || isBlackTree(tree) - private[this] def isRedTree(tree: Tree[_, _]) = tree.isInstanceOf[RedTree[_, _]] - private[this] def isBlackTree(tree: Tree[_, _]) = tree.isInstanceOf[BlackTree[_, _]] + private[this] def isRedTree(tree: Tree[?, ?]) = tree.isInstanceOf[RedTree[?, ?]] + private[this] def isBlackTree(tree: Tree[?, ?]) = tree.isInstanceOf[BlackTree[?, ?]] private[this] def blacken[A, B](t: Tree[A, B]): Tree[A, B] = if (t eq null) null else t.black @@ -192,7 +192,7 @@ object RedBlackTree { BlackTree(x, xv, tl, tr) } def subl(t: Tree[A, B]) = - if (t.isInstanceOf[BlackTree[_, _]]) t.red + if (t.isInstanceOf[BlackTree[?, ?]]) t.red else sys.error("Defect: invariance violation; expected black, got "+t) def balLeft(x: A, xv: B, tl: Tree[A, B], tr: Tree[A, B]) = if (isRedTree(tl)) { diff --git a/tests/init/pos/Properties.scala b/tests/init/pos/Properties.scala index 84d1e09a24f9..ba92dd54dc83 100644 --- a/tests/init/pos/Properties.scala +++ b/tests/init/pos/Properties.scala @@ -15,7 +15,7 @@ import java.util.jar.Attributes.Name as AttributeName private[scala] trait PropertiesTrait { protected def propCategory: String // specializes the remainder of the values - protected def pickJarBasedOn: Class[_] // props file comes from jar containing this + protected def pickJarBasedOn: Class[?] // props file comes from jar containing this /** The name of the properties file */ protected val propFilename = "/" + propCategory + ".properties" diff --git a/tests/neg-deep-subtype/i11064.scala b/tests/neg-deep-subtype/i11064.scala index 7cfab64d0e04..f00ef3125464 100644 --- a/tests/neg-deep-subtype/i11064.scala +++ b/tests/neg-deep-subtype/i11064.scala @@ -1,9 +1,9 @@ trait TypedArray[T, Repr] -trait Ops[T <: TypedArray[_, T]] { +trait Ops[T <: TypedArray[?, T]] { def typedArray(): T } object Test { - def test(ops: Ops[_ <: TypedArray[_ <: AnyRef, _]]) = ops.typedArray() // error: Recursion limit exceeded. + def test(ops: Ops[_ <: TypedArray[? <: AnyRef, ?]]) = ops.typedArray() // error: Recursion limit exceeded. } \ No newline at end of file diff --git a/tests/neg-deep-subtype/i3627.scala b/tests/neg-deep-subtype/i3627.scala index f97d6e67d582..0f9c3f4b0287 100644 --- a/tests/neg-deep-subtype/i3627.scala +++ b/tests/neg-deep-subtype/i3627.scala @@ -1,9 +1,9 @@ trait Comparinator[T] { - def sort[T](x: Comparinator[_ >: T]) = () + def sort[T](x: Comparinator[? >: T]) = () sort((a: Int) => true) // error } trait Comparinator2[T >: U, U] { - def sort[TT](x: Comparinator2[_ >: TT, U]) = () + def sort[TT](x: Comparinator2[? >: TT, U]) = () sort((a: Int) => true) // error } diff --git a/tests/neg-deep-subtype/i4297.scala b/tests/neg-deep-subtype/i4297.scala index 9112de9de79b..88e66c59d1b4 100644 --- a/tests/neg-deep-subtype/i4297.scala +++ b/tests/neg-deep-subtype/i4297.scala @@ -3,11 +3,11 @@ class Test { def test[X <: Option[Int]](x: X) = x.isInstanceOf[Some[Int]] def test1[Y <: Int, X <: Option[Y]](x: X) = x.isInstanceOf[Some[Int]] - def test2(x: Any) = x.isInstanceOf[Function1[Nothing, _]] - def test3a(x: Any) = x.isInstanceOf[Function1[Any, _]] // error - def test3b(x: Any) = x.isInstanceOf[Function1[Int, _]] // error - def test4[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, _]] // error + def test2(x: Any) = x.isInstanceOf[Function1[Nothing, ?]] + def test3a(x: Any) = x.isInstanceOf[Function1[Any, ?]] // error + def test3b(x: Any) = x.isInstanceOf[Function1[Int, ?]] // error + def test4[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, ?]] // error def test5[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, Unit]] // error def test6[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[Int, Any]] // error - def test7[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[_, Unit]] + def test7[Y <: Int, X <: Function1[Y, Unit]](x: X) = x.isInstanceOf[Function1[?, Unit]] } diff --git a/tests/neg-deep-subtype/i4372.scala b/tests/neg-deep-subtype/i4372.scala index e6e75061bb02..bb28a37229c0 100644 --- a/tests/neg-deep-subtype/i4372.scala +++ b/tests/neg-deep-subtype/i4372.scala @@ -1,3 +1,3 @@ object i4372 { - class X[A >: X[_ <: X[_]] <: X[A]] // error: too deep + class X[A >: X[? <: X[?]] <: X[A]] // error: too deep } diff --git a/tests/neg-deep-subtype/i5826b.scala b/tests/neg-deep-subtype/i5826b.scala index 2ee8ac2b092a..a3c3382bbc51 100644 --- a/tests/neg-deep-subtype/i5826b.scala +++ b/tests/neg-deep-subtype/i5826b.scala @@ -2,12 +2,12 @@ class Foo { def test1[A]: List[Int] | A => Int = { - case ls: List[_] => ls.head // error + case ls: List[?] => ls.head // error case _ => 0 } def test2[A]: List[Int] | A => Int = { - case ls: List[_] => ls.size + case ls: List[?] => ls.size case _ => 0 } } diff --git a/tests/neg-deep-subtype/i5877.scala b/tests/neg-deep-subtype/i5877.scala index c1d5ea4a31c1..8945c3550cc7 100644 --- a/tests/neg-deep-subtype/i5877.scala +++ b/tests/neg-deep-subtype/i5877.scala @@ -8,7 +8,7 @@ object Main { // ---- ---- ---- ---- - trait HasThisType[PThis <: HasThisType[_ <: PThis]] { + trait HasThisType[PThis <: HasThisType[? <: PThis]] { this: PThis => type This = PThis @@ -19,22 +19,22 @@ object Main { // ---- ---- ---- ---- def testHasThisType(): Unit = { - def testSelf[PThis <: HasThisType[_ <: PThis]](that: HasThisType[PThis]): Unit = { + def testSelf[PThis <: HasThisType[? <: PThis]](that: HasThisType[PThis]): Unit = { val thatSelf = that.self() // that.self().type <: that.This assert(implicitly[thatSelf.type <:< that.This] != null) } - val that: HasThisType[_] = Foo() // null.asInstanceOf + val that: HasThisType[?] = Foo() // null.asInstanceOf testSelf(that) // error: recursion limit exceeded } def testHasThisType2(): Unit = { - def testSelf[PThis <: HasThisType[_ <: PThis]](that: PThis with HasThisType[PThis]): Unit = { + def testSelf[PThis <: HasThisType[? <: PThis]](that: PThis with HasThisType[PThis]): Unit = { // that.type <: that.This assert(implicitly[that.type <:< that.This] != null) } - val that: HasThisType[_] = Foo() // null.asInstanceOf + val that: HasThisType[?] = Foo() // null.asInstanceOf // this line of code makes Dotty compiler infinite recursion (stopped only by overflow) - comment it to make it compilable again testSelf(that) // error: recursion limit exceeded } @@ -42,10 +42,10 @@ object Main { // ---- ---- ---- ---- // `HasThisType` instantiation/sub-classing - trait FooLike[PThis <: FooLike[_ <: PThis]] extends HasThisType[PThis] { + trait FooLike[PThis <: FooLike[? <: PThis]] extends HasThisType[PThis] { this: PThis => } case class Foo(payload: Any = "dummy") extends FooLike[Foo] - case class Bar(dummy: Any = "payload") extends FooLike[FooLike[_]] + case class Bar(dummy: Any = "payload") extends FooLike[FooLike[?]] } diff --git a/tests/neg-deep-subtype/or-type-trees.scala b/tests/neg-deep-subtype/or-type-trees.scala index ad86bf20e2a3..d0338ffe6066 100644 --- a/tests/neg-deep-subtype/or-type-trees.scala +++ b/tests/neg-deep-subtype/or-type-trees.scala @@ -14,7 +14,7 @@ object Test1 { def foo3(myTree: Tree | (Context => Tree)) = myTree match - case treeFn: (_ => _) => // ok + case treeFn: (? => ?) => // ok case _ => } @@ -35,6 +35,6 @@ object Test2 { def foo3(myTree: Tree[Type] | (Context => Tree[Type])) = myTree match - case treeFn: (_ => _) => // ok + case treeFn: (? => ?) => // ok case _ => } \ No newline at end of file diff --git a/tests/neg-deep-subtype/t2755.scala b/tests/neg-deep-subtype/t2755.scala index a8d888f3a821..ec3cb6aadefc 100644 --- a/tests/neg-deep-subtype/t2755.scala +++ b/tests/neg-deep-subtype/t2755.scala @@ -9,16 +9,16 @@ object Test { case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 } - def f2(a: Array[_]) = a match { + def f2(a: Array[?]) = a match { case x: Array[Int] => x(0) case x: Array[Double] => 2 case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 // error: only null is matched } def f3[T](a: Array[T]) = a match { @@ -27,7 +27,7 @@ object Test { case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 // error: only null is matched } diff --git a/tests/neg-macros/i10127-b.scala b/tests/neg-macros/i10127-b.scala index 13992bf95362..7d1c64431b76 100644 --- a/tests/neg-macros/i10127-b.scala +++ b/tests/neg-macros/i10127-b.scala @@ -1,6 +1,6 @@ import scala.quoted.* -case class T(x: Type[_ <: Any]) +case class T(x: Type[? <: Any]) object T { def impl[A](t: T)(using ctx: Quotes): Expr[Unit] = { diff --git a/tests/neg-macros/i13406/Test_2.scala b/tests/neg-macros/i13406/Test_2.scala index f2cb0a3f05ee..071648abb09c 100644 --- a/tests/neg-macros/i13406/Test_2.scala +++ b/tests/neg-macros/i13406/Test_2.scala @@ -1,7 +1,7 @@ // Test_2.scala trait Bar -inline given derivedReducible(using scala.deriving.Mirror.SumOf[Qux[_]]): Bar = +inline given derivedReducible(using scala.deriving.Mirror.SumOf[Qux[?]]): Bar = scala.compiletime.summonInline[Bar] ??? diff --git a/tests/neg-macros/i15917.scala b/tests/neg-macros/i15917.scala index 3eecc38b21f9..6259574f738f 100644 --- a/tests/neg-macros/i15917.scala +++ b/tests/neg-macros/i15917.scala @@ -1,6 +1,6 @@ import scala.quoted.* -def m(using Quotes): Expr[Option[_]] = +def m(using Quotes): Expr[Option[?]] = val s = 3 type st = s.type '{ Some(${ Expr(s) }: st) } // error diff --git a/tests/neg-macros/i6997.scala b/tests/neg-macros/i6997.scala index d426d73ebf06..1834a4c6d9bf 100644 --- a/tests/neg-macros/i6997.scala +++ b/tests/neg-macros/i6997.scala @@ -1,7 +1,7 @@ import scala.quoted.* class Foo { - def mcrImpl(body: Expr[Any])(using t: Type[_ <: Any])(using ctx: Quotes): Expr[Any] = '{ + def mcrImpl(body: Expr[Any])(using t: Type[? <: Any])(using ctx: Quotes): Expr[Any] = '{ val tmp = ???.asInstanceOf[t.Underlying] // error // error tmp } diff --git a/tests/neg-macros/i8871.scala b/tests/neg-macros/i8871.scala index 4956061d45fa..5058ac2df7a5 100644 --- a/tests/neg-macros/i8871.scala +++ b/tests/neg-macros/i8871.scala @@ -2,7 +2,7 @@ import scala.quoted.* object Macro { def impl[A : Type](using Quotes): Unit = { import quotes.reflect.* - val tpe = TypeRepr.of[A].asType.asInstanceOf[Type[_ <: AnyRef]] + val tpe = TypeRepr.of[A].asType.asInstanceOf[Type[? <: AnyRef]] '{ (a: ${tpe}) => ???} // error } } diff --git a/tests/neg/10349.scala b/tests/neg/10349.scala index 4ea683f6a8fb..27a35d36661f 100644 --- a/tests/neg/10349.scala +++ b/tests/neg/10349.scala @@ -1,10 +1,10 @@ object Firsts: type First[X] = X match - case Map[_, v] => First[Option[v]] + case Map[?, v] => First[Option[v]] def first[X](x: X): First[X] = x match - case x: Map[_, _] => first(x.values.headOption) // error + case x: Map[?, ?] => first(x.values.headOption) // error @main def runFirsts2(): Unit = diff --git a/tests/neg/12974.scala b/tests/neg/12974.scala index 90edcc916471..d3778af7be7a 100644 --- a/tests/neg/12974.scala +++ b/tests/neg/12974.scala @@ -9,8 +9,8 @@ object RecMap { object Rec { type HasKey[A <: Tuple, K] = A match - case (K, t) *: _ => t - case _ *: t => HasKey[t, K] + case (K, t) *: ? => t + case ? *: t => HasKey[t, K] val empty: Rec[EmptyTuple] = Map.empty diff --git a/tests/neg/4376.scala b/tests/neg/4376.scala index 527dc82aa9f7..2dcba87c739e 100644 --- a/tests/neg/4376.scala +++ b/tests/neg/4376.scala @@ -1,6 +1,6 @@ object App { type Id[A] >: A <: A - val a: Array[_ >: Id[_ <: Int]] = - (Array.ofDim[String](1) : Array[_ >: Id[Nothing]]) // error + val a: Array[? >: Id[? <: Int]] = + (Array.ofDim[String](1) : Array[? >: Id[Nothing]]) // error } diff --git a/tests/neg/7043.scala b/tests/neg/7043.scala index df8e7e0e016e..1bd874f2ff00 100644 --- a/tests/neg/7043.scala +++ b/tests/neg/7043.scala @@ -1,11 +1,11 @@ object Test { type StrHead[X <: Tuple] = X match { - case (x <: String) *: _ => x // error + case (x <: String) *: ? => x // error } // Futher minimized type M[X] = X match { - case (x) *: _ => Int + case (x) *: ? => Int } // The exception can also be reached with normal pattern matching diff --git a/tests/neg/IsInstanceOfClassTag.scala b/tests/neg/IsInstanceOfClassTag.scala index 65a7ecb031b2..139ca7eae5a6 100644 --- a/tests/neg/IsInstanceOfClassTag.scala +++ b/tests/neg/IsInstanceOfClassTag.scala @@ -17,7 +17,7 @@ object IsInstanceOfClassTag { xs.head.substring(0) } - safeCast[List[_]](List[Int](1)) match { + safeCast[List[?]](List[Int](1)) match { case None => case Some(xs) => xs.head.substring(0) // error diff --git a/tests/neg/IsInstanceOfClassTag2.scala b/tests/neg/IsInstanceOfClassTag2.scala index 9246c7fca84d..9d32ee401092 100644 --- a/tests/neg/IsInstanceOfClassTag2.scala +++ b/tests/neg/IsInstanceOfClassTag2.scala @@ -16,7 +16,7 @@ object IsInstanceOfClassTag { case Some(xs) => } - safeCast[List[_]](List[Int](1)) match { + safeCast[List[?]](List[Int](1)) match { case None => case Some(xs) => } diff --git a/tests/neg/and-wildcard.scala b/tests/neg/and-wildcard.scala index c4cf7baaa10f..a0f61300b5e9 100644 --- a/tests/neg/and-wildcard.scala +++ b/tests/neg/and-wildcard.scala @@ -2,5 +2,5 @@ object Test { type And[X, Y] = X & Y - val x: And[_, _] = ??? // error: unreducible + val x: And[?, ?] = ??? // error: unreducible } \ No newline at end of file diff --git a/tests/neg/boundspropagation.scala b/tests/neg/boundspropagation.scala index 8adf73d33453..22f356104069 100644 --- a/tests/neg/boundspropagation.scala +++ b/tests/neg/boundspropagation.scala @@ -5,7 +5,7 @@ object test1 { def f(x: Any): Tree[Null] = x match { - case y: Tree[_] => y + case y: Tree[?] => y } } object test2 { @@ -13,7 +13,7 @@ object test2 { def f(x: Any): Tree[Null] = x match { - case y: Tree[_] => y // error + case y: Tree[?] => y // error } } object test3 { @@ -21,7 +21,7 @@ object test3 { def f(x: Any): Tree[Null] = x match { - case y: Tree[_] => y // error + case y: Tree[?] => y // error } } diff --git a/tests/neg/enum-constrs.scala b/tests/neg/enum-constrs.scala index 13c39628044d..8846e2e148db 100644 --- a/tests/neg/enum-constrs.scala +++ b/tests/neg/enum-constrs.scala @@ -1,5 +1,5 @@ -enum E[+T] extends java.lang.Enum[E[_]] { +enum E[+T] extends java.lang.Enum[E[?]] { case S1, S2 case C() extends E[Int] // error: parameterized case is not allowed } diff --git a/tests/neg/enumsAccess.scala b/tests/neg/enumsAccess.scala index 8a8e9af8910f..072ff504b809 100644 --- a/tests/neg/enumsAccess.scala +++ b/tests/neg/enumsAccess.scala @@ -63,7 +63,7 @@ object test5 { enum E5[T](x: T) { case C3() extends E5[INT](defaultX)// error: illegal reference // error: illegal reference case C4 extends E5[INT](defaultX) // error: illegal reference // error: illegal reference - case C5 extends E5[E5[_]](E5.this) // error: cannot be instantiated // error: conflicting base types // error: type mismatch + case C5 extends E5[E5[?]](E5.this) // error: cannot be instantiated // error: conflicting base types // error: type mismatch } object E5 { diff --git a/tests/neg/existentials.scala b/tests/neg/existentials.scala index c2128b2b91f5..6ecdfb3bbf41 100644 --- a/tests/neg/existentials.scala +++ b/tests/neg/existentials.scala @@ -1,32 +1,32 @@ object TestList { - var x: ([X] =>> List[List[X]])[_] = List(List(1)) // error: unreducible - var y: ([X] =>> List[Seq[X]])[_] = List(List(1)) // error: unreducible + var x: ([X] =>> List[List[X]])[?] = List(List(1)) // error: unreducible + var y: ([X] =>> List[Seq[X]])[?] = List(List(1)) // error: unreducible x = x y = y y = x val h = x.head - val x1: List[_] = h + val x1: List[?] = h - var z: List[_] = x + var z: List[?] = x } object TestSet { - var x: ([Y] =>> Set[Set[Y]])[_] = Set(Set("a")) // error: unreducible - var y: ([Y] =>> Set[Iterable[Y]])[_] = Set(Set("a")) // error: unreducible + var x: ([Y] =>> Set[Set[Y]])[?] = Set(Set("a")) // error: unreducible + var y: ([Y] =>> Set[Iterable[Y]])[?] = Set(Set("a")) // error: unreducible x = x y = y val h = x.head - val h1: Set[_] = h + val h1: Set[?] = h // val p = x.+ // infinite loop in implicit search - var z: Set[_] = x + var z: Set[?] = x } class TestX { @@ -36,15 +36,15 @@ class TestX { def cmp: T => Boolean = (x == _) } - val x: ([Y] =>> C[C[Y]])[_] = new C(new C("a")) // error: unreducible + val x: ([Y] =>> C[C[Y]])[?] = new C(new C("a")) // error: unreducible type CC[X] = C[C[X]] - val y: CC[_] = ??? // error: unreducible + val y: CC[?] = ??? // error: unreducible type D[X] <: C[X] type DD = [X] =>> D[D[X]] - val z: DD[_] = ??? // error: unreducible + val z: DD[?] = ??? // error: unreducible val g = x.get @@ -55,7 +55,7 @@ object Test6014 { case class CC[T](key: T) type Alias[T] = Seq[CC[T]] - def f(xs: Seq[CC[_]]) = xs map { case CC(x) => CC(x) } // ok - def g(xs: Alias[_]) = xs map { case CC(x) => CC(x) } // error: unreducible application + def f(xs: Seq[CC[?]]) = xs map { case CC(x) => CC(x) } // ok + def g(xs: Alias[?]) = xs map { case CC(x) => CC(x) } // error: unreducible application } diff --git a/tests/neg/i0583-skolemize.scala b/tests/neg/i0583-skolemize.scala index c36a4486a259..b21800a1b337 100644 --- a/tests/neg/i0583-skolemize.scala +++ b/tests/neg/i0583-skolemize.scala @@ -10,7 +10,7 @@ object Test1 { val c: C[Int] = ??? val d: C[Float] = ??? - val xs: List[C[_]] = List(c, d) + val xs: List[C[?]] = List(c, d) xs(0).x = xs(1).x // error @@ -19,7 +19,7 @@ object Test { def main(args: Array[String]): Unit = { val f: ListBuffer[Int] = ListBuffer(1,2) val g: ListBuffer[Double] = ListBuffer(3.0,4.0) - val lb: ListBuffer[ListBuffer[_]] = ListBuffer(f, g) + val lb: ListBuffer[ListBuffer[?]] = ListBuffer(f, g) lb(0)(0) = lb(1)(0) // error val x: Int = f(0) } diff --git a/tests/neg/i12049.scala b/tests/neg/i12049.scala index e69ac9e7a217..1b3785aa27c7 100644 --- a/tests/neg/i12049.scala +++ b/tests/neg/i12049.scala @@ -6,7 +6,7 @@ type M[X] = X match val x: String = ??? : M[B] // error type Last[X <: Tuple] = X match - case _ *: _ *: t => Last[t] + case ? *: ? *: t => Last[t] case t *: EmptyTuple => t val y1: Int = ??? : Last[Int *: EmptyTuple] diff --git a/tests/neg/i12169.scala b/tests/neg/i12169.scala index 78507c369b1c..88d72ae801a1 100644 --- a/tests/neg/i12169.scala +++ b/tests/neg/i12169.scala @@ -14,7 +14,7 @@ private final class FlatVarCellView[T <: Txn[T], B]( def Test = val opt: Option[Form[TT]] = ??? val firstVr = opt match - case Some(ex: Var.Expanded[TT, _]) => Some(ex) + case Some(ex: Var.Expanded[TT, ?]) => Some(ex) case _ => None new FlatVarCellView(firstVr) // error // Found: (firstVr : Option[Var.Expanded[TT, ?]]) @@ -28,7 +28,7 @@ def Test = // Remedy: opt match - case Some(ex: Var.Expanded[TT, _]) => new FlatVarCellView(Some(ex)) + case Some(ex: Var.Expanded[TT, ?]) => new FlatVarCellView(Some(ex)) // here, we instantiate `B` with the unnamed second parameter of `Var.Expanded` case _ => new FlatVarCellView(None) opt match diff --git a/tests/neg/i12284.scala b/tests/neg/i12284.scala index 11635a1638cb..c1e35a3eac41 100644 --- a/tests/neg/i12284.scala +++ b/tests/neg/i12284.scala @@ -1,7 +1,7 @@ trait I[F[_], A] def magic[F[_], A](in: I[F, A]): F[A] = - val deps: Vector[I[F, _]] = ??? + val deps: Vector[I[F, ?]] = ??? val xx = deps.map(i => magic(i)) val y: Vector[F[Any]] = xx // error ??? diff --git a/tests/neg/i13769.check b/tests/neg/i13769.check index 8291a84fc899..cf8580853afe 100644 --- a/tests/neg/i13769.check +++ b/tests/neg/i13769.check @@ -1,5 +1,5 @@ -- [E035] Syntax Error: tests/neg/i13769.scala:2:21 -------------------------------------------------------------------- -2 |val te = tup.map((x: _ <: Int) => List(x)) // error +2 |val te = tup.map((x: ? <: Int) => List(x)) // error | ^^^^^^^^ | Unbound wildcard type | diff --git a/tests/neg/i13769.scala b/tests/neg/i13769.scala index e4e66fe2cef2..35ffbfc6b5c4 100644 --- a/tests/neg/i13769.scala +++ b/tests/neg/i13769.scala @@ -1,2 +1,2 @@ val tup = (1, "s") -val te = tup.map((x: _ <: Int) => List(x)) // error +val te = tup.map((x: ? <: Int) => List(x)) // error diff --git a/tests/neg/i15311.scala b/tests/neg/i15311.scala index 10cebfe12408..fd9d614bba26 100644 --- a/tests/neg/i15311.scala +++ b/tests/neg/i15311.scala @@ -2,7 +2,7 @@ trait Template[+T <: Template[T]]: type Clone <: T { type Clone = Template.this.Clone } val self :Clone -type Food = Template[_] +type Food = Template[?] class Ham extends Template[Ham]: type Clone = Ham diff --git a/tests/neg/i15569.scala b/tests/neg/i15569.scala index b8e744aa7a81..0c896d589811 100644 --- a/tests/neg/i15569.scala +++ b/tests/neg/i15569.scala @@ -20,7 +20,7 @@ def andThenSub[A, B, C](f: A <:< B, g: B <:< C): A <:< C = } @main def Test3ok = (None: Option[Foo[?]]) match { - case _: Option[Foo[_]] => // ok + case _: Option[Foo[?]] => // ok } @main def Test4 = diff --git a/tests/neg/i15662.scala b/tests/neg/i15662.scala index 1b6070f26e00..c84ed6e5e341 100644 --- a/tests/neg/i15662.scala +++ b/tests/neg/i15662.scala @@ -2,12 +2,12 @@ case class Composite[T](v: T) -def m(composite: Composite[_]): Unit = +def m(composite: Composite[?]): Unit = composite match { case Composite[Int](v) => println(v) // error: cannot be checked at runtime } -def m2(composite: Composite[_]): Unit = +def m2(composite: Composite[?]): Unit = composite match { case Composite(v) => println(v) // ok } diff --git a/tests/neg/i15893.scala b/tests/neg/i15893.scala index d66da9ebec8b..a62ddc3ae653 100644 --- a/tests/neg/i15893.scala +++ b/tests/neg/i15893.scala @@ -27,17 +27,17 @@ transparent inline def transparentInlineMod2(inline n: NatT): NatT = inline n m def dependentlyTypedMod2[N <: NatT](n: N): Mod2[N] = n match case Zero(): Zero => Zero() // error case Succ(Zero()): Succ[Zero] => Succ(Zero()) // error - case Succ(Succ(predPredN)): Succ[Succ[_]] => dependentlyTypedMod2(predPredN) // error + case Succ(Succ(predPredN)): Succ[Succ[?]] => dependentlyTypedMod2(predPredN) // error inline def inlineDependentlyTypedMod2[N <: NatT](inline n: N): Mod2[N] = inline n match case Zero(): Zero => Zero() // error case Succ(Zero()): Succ[Zero] => Succ(Zero()) // error - case Succ(Succ(predPredN)): Succ[Succ[_]] => inlineDependentlyTypedMod2(predPredN) // error + case Succ(Succ(predPredN)): Succ[Succ[?]] => inlineDependentlyTypedMod2(predPredN) // error transparent inline def transparentInlineDependentlyTypedMod2[N <: NatT](inline n: N): Mod2[N] = inline n match case Zero(): Zero => Zero() // error case Succ(Zero()): Succ[Zero] => Succ(Zero()) // error - case Succ(Succ(predPredN)): Succ[Succ[_]] => transparentInlineDependentlyTypedMod2(predPredN) // error + case Succ(Succ(predPredN)): Succ[Succ[?]] => transparentInlineDependentlyTypedMod2(predPredN) // error def foo(n: NatT): NatT = mod2(n) match case Succ(Zero()) => Zero() diff --git a/tests/neg/i17149.scala b/tests/neg/i17149.scala index 17f3f901e457..3a8afb603bc0 100644 --- a/tests/neg/i17149.scala +++ b/tests/neg/i17149.scala @@ -2,13 +2,13 @@ type Ext1[S] = S match { case Seq[t] => t } type Ext2[S] = S match { - case Seq[_] => Int + case Seq[?] => Int } type Ext3[S] = S match { case Array[t] => t } type Ext4[S] = S match { - case Array[_] => Int + case Array[?] => Int } def foo[T <: Seq[Any], A <: Array[B], B] = summon[Ext1[T] =:= T] // error diff --git a/tests/neg/i18058.check b/tests/neg/i18058.check index 2622eeb82a45..f610d9e7abb1 100644 --- a/tests/neg/i18058.check +++ b/tests/neg/i18058.check @@ -1,4 +1,4 @@ -- Error: tests/neg/i18058.scala:4:21 ---------------------------------------------------------------------------------- -4 |type G = (f: _ <: F) => f.A // error +4 |type G = (f: ? <: F) => f.A // error | ^ | invalid new prefix <: F cannot replace f.type in type f.A diff --git a/tests/neg/i18058.scala b/tests/neg/i18058.scala index b7309294aade..b032f810d2fd 100644 --- a/tests/neg/i18058.scala +++ b/tests/neg/i18058.scala @@ -1,4 +1,4 @@ trait F: type A -type G = (f: _ <: F) => f.A // error +type G = (f: ? <: F) => f.A // error diff --git a/tests/neg/i2928.scala b/tests/neg/i2928.scala index 7b2b54a7f091..7a4d1928776c 100644 --- a/tests/neg/i2928.scala +++ b/tests/neg/i2928.scala @@ -5,7 +5,7 @@ object Test { val s = new Box[String]("") val i = new Box[Int](3) - var box: Box[_] = s + var box: Box[?] = s val sv = box.v box = i box.v = sv // error diff --git a/tests/neg/i3442.scala b/tests/neg/i3442.scala index 0959be87765e..3612d30578bd 100644 --- a/tests/neg/i3442.scala +++ b/tests/neg/i3442.scala @@ -1,6 +1,6 @@ class Test { // Any - override def getClass(): Class[_] = ??? // error + override def getClass(): Class[?] = ??? // error override def ==(that: Any): Boolean = ??? // error override def != (that: Any): Boolean = ??? // error override def ##(): Int = ??? // error diff --git a/tests/neg/i3976.scala b/tests/neg/i3976.scala index f5c1ac4bfcc0..681da092d8f2 100644 --- a/tests/neg/i3976.scala +++ b/tests/neg/i3976.scala @@ -6,7 +6,7 @@ object Test { import Hoge.* A == A - A == (B: Hoge[_]) + A == (B: Hoge[?]) A == B // should be error: cannot be compared, needs proper type class drivation of `CanEqual` to get there. @@ -25,7 +25,7 @@ object Test2 { import Hoge.* A == A - A == (B: Hoge[_]) + A == (B: Hoge[?]) A == B @@ -44,7 +44,7 @@ object Test3 { import Hoge.* A == A - A == (B: Hoge[_]) + A == (B: Hoge[?]) A == B diff --git a/tests/neg/i3989a.scala b/tests/neg/i3989a.scala index 8ff02ac0c2f1..72715d35f9a0 100644 --- a/tests/neg/i3989a.scala +++ b/tests/neg/i3989a.scala @@ -3,7 +3,7 @@ object Test extends App { class B[+X](val x: X) extends A[X] class C[+X](x: Any) extends B[Any](x) with A[X] def f(a: A[Int]): Int = a match { - case a: B[_] => a.x // error + case a: B[?] => a.x // error case _ => 0 } f(new C[Int]("foo")) diff --git a/tests/neg/i4373.scala b/tests/neg/i4373.scala index 458dfc09c150..89c5b86dcd87 100644 --- a/tests/neg/i4373.scala +++ b/tests/neg/i4373.scala @@ -1,27 +1,27 @@ trait Base trait TypeConstr[X] -class X1[A >: _ | X1[_]] // error -class X2[A >: _ & X2[_]] // error -class X3[A >: X3[_] | _] // error -class X4[A >: X4[_] & _] // error -class X5[A >: _ with X5[_]] // error -class X6[A >: X6[_] with _] // error - -class A1 extends _ // error -class A2 extends _ with _ // error -class A3 extends Base with _ // error -class A4 extends _ with Base // error +class X1[A >: ? | X1[?]] // error +class X2[A >: ? & X2[?]] // error +class X3[A >: X3[?] | ?] // error +class X4[A >: X4[?] & ?] // error +class X5[A >: ? with X5[?]] // error +class X6[A >: X6[?] with ?] // error + +class A1 extends ? // error +class A2 extends ? with ? // error // error +class A3 extends Base with ? // error +class A4 extends ? with Base // error object Test { - type T1 = _ // error - type T2 = _[Int] // error - type T3 = _ { type S } // error - type T4 = [X] =>> _ // error + type T1 = ? // error + type T2 = ?[Int] // error + type T3 = ? { type S } // error + type T4 = [X] =>> ? // error // Open questions: - type T5 = TypeConstr[_ { type S }] // error - type T6 = TypeConstr[_[Int]] // error + type T5 = TypeConstr[? { type S }] // error + type T6 = TypeConstr[?[Int]] // error // expression types type T7 = (=> Int) | (Int => Int) // error @@ -32,20 +32,20 @@ object Test { type T12 = (Int => Int) with (=> Int) // error // annotations - type T13 = _ @ annotation.tailrec // error - type T14 = Int @ _ // error - type T15 = (_ | Int) @ annotation.tailrec // error - type T16 = (Int | _) @ annotation.tailrec // error - type T17 = Int @ (_ | annotation.tailrec) // error - type T18 = Int @ (annotation.tailrec | _) // error - - type T19 = (_ with Int) @ annotation.tailrec // error - type T20 = (Int with _) @ annotation.tailrec // error - type T21 = Int @ (_ with annotation.tailrec) // error - type T22 = Int @ (annotation.tailrec with _) // error - - type T23 = (_ & Int) @ annotation.tailrec // error - type T24 = (Int & _) @ annotation.tailrec // error - type T25 = Int @ (_ & annotation.tailrec) // error - type T26 = Int @ (annotation.tailrec & _) // error + type T13 = ? @ annotation.tailrec // error + type T14 = Int @ ? // error + type T15 = (? | Int) @ annotation.tailrec // error + type T16 = (Int | ?) @ annotation.tailrec // error + type T17 = Int @ (? | annotation.tailrec) // error + type T18 = Int @ (annotation.tailrec | ?) // error + + type T19 = (? with Int) @ annotation.tailrec // error + type T20 = (Int with ?) @ annotation.tailrec // error + type T21 = Int @ (? with annotation.tailrec) // error + type T22 = Int @ (annotation.tailrec with ?) // error + + type T23 = (? & Int) @ annotation.tailrec // error + type T24 = (Int & ?) @ annotation.tailrec // error + type T25 = Int @ (? & annotation.tailrec) // error + type T26 = Int @ (annotation.tailrec & ?) // error } diff --git a/tests/neg/i4373c.scala b/tests/neg/i4373c.scala index ab405a14d29a..91a76d1c0ba7 100644 --- a/tests/neg/i4373c.scala +++ b/tests/neg/i4373c.scala @@ -1,3 +1,3 @@ // ==> 18b253a4a89a84c5674165c6fc3efafad535eee3.scala <== object x0 { - def x1[x2 <:_[ // error + def x1[x2 <:_[ // error // error diff --git a/tests/neg/i4376.scala b/tests/neg/i4376.scala index 69daceafdbc3..cf81b3229323 100644 --- a/tests/neg/i4376.scala +++ b/tests/neg/i4376.scala @@ -1,6 +1,6 @@ object App { type Id[A] >: A <: A - val a: Array[_ >: Id[_ <: Int]] = - (Array.ofDim[String](1) : Array[_ >: Id[Nothing]]) // error + val a: Array[? >: Id[? <: Int]] = + (Array.ofDim[String](1) : Array[? >: Id[Nothing]]) // error } \ No newline at end of file diff --git a/tests/neg/i4382.check b/tests/neg/i4382.check index 4905638ab62a..bf4dc4a192d8 100644 --- a/tests/neg/i4382.check +++ b/tests/neg/i4382.check @@ -1,23 +1,23 @@ -- [E043] Type Error: tests/neg/i4382.scala:3:10 ----------------------------------------------------------------------- -3 | def v1: Id[_] = ??? // error +3 | def v1: Id[?] = ??? // error | ^^^^^ | unreducible application of higher-kinded type App.Id to wildcard arguments | | longer explanation available when compiling with `-explain` -- [E043] Type Error: tests/neg/i4382.scala:6:10 ----------------------------------------------------------------------- -6 | def v2: HkL[_] = ??? // error +6 | def v2: HkL[?] = ??? // error | ^^^^^^ | unreducible application of higher-kinded type App.HkL to wildcard arguments | | longer explanation available when compiling with `-explain` -- [E043] Type Error: tests/neg/i4382.scala:9:10 ----------------------------------------------------------------------- -9 | def v3: HkU[_] = ??? // error +9 | def v3: HkU[?] = ??? // error | ^^^^^^ | unreducible application of higher-kinded type App.HkU to wildcard arguments | | longer explanation available when compiling with `-explain` -- [E043] Type Error: tests/neg/i4382.scala:12:10 ---------------------------------------------------------------------- -12 | def v4: HkAbs[_] = ??? // error +12 | def v4: HkAbs[?] = ??? // error | ^^^^^^^^ | unreducible application of higher-kinded type App.HkAbs to wildcard arguments | diff --git a/tests/neg/i4382.scala b/tests/neg/i4382.scala index aefe23094ce9..80f0948fa82c 100644 --- a/tests/neg/i4382.scala +++ b/tests/neg/i4382.scala @@ -1,13 +1,13 @@ object App { type Id[A] >: A <: A - def v1: Id[_] = ??? // error + def v1: Id[?] = ??? // error type HkL[A] >: A - def v2: HkL[_] = ??? // error + def v2: HkL[?] = ??? // error type HkU[A] <: A - def v3: HkU[_] = ??? // error + def v3: HkU[?] = ??? // error type HkAbs[A] - def v4: HkAbs[_] = ??? // error + def v4: HkAbs[?] = ??? // error } diff --git a/tests/neg/i4986c.scala b/tests/neg/i4986c.scala index 31458a7e9cbb..13b608a69707 100644 --- a/tests/neg/i4986c.scala +++ b/tests/neg/i4986c.scala @@ -57,7 +57,7 @@ object Test { implicitly[U[Int, Option, Map]] // error - val u = new U[String, List, [A, _] =>> List[Option[_]]] { } + val u = new U[String, List, [A, _] =>> List[Option[?]]] { } val i = new u.I[Int] i.m[Option[Long]] // error } diff --git a/tests/neg/i5077.scala b/tests/neg/i5077.scala index 64de24bfd669..d705ffe52dd9 100644 --- a/tests/neg/i5077.scala +++ b/tests/neg/i5077.scala @@ -7,7 +7,7 @@ case class C[A](is: Is[A], value: A) @main def Test = { val c_string: C[String] = C(IsString, "name") - val c_any: C[_] = c_string + val c_any: C[?] = c_string val any: Any = c_string // Case 1: error diff --git a/tests/neg/i5948b.scala b/tests/neg/i5948b.scala index 0961fc8f2f0c..667ddbbe6019 100644 --- a/tests/neg/i5948b.scala +++ b/tests/neg/i5948b.scala @@ -12,7 +12,7 @@ object Test { def test1(): Unit = { val fooInt = new Foo(1) val fooString = new Foo("") - val pair: (Foo[_], Foo[_]) = (fooInt, fooString) + val pair: (Foo[?], Foo[?]) = (fooInt, fooString) setFirstInPair(pair) // error println(fooInt.elem + 1) } @@ -20,7 +20,7 @@ object Test { def test2(): Unit = { val fooInt = new Foo(1) val fooString = new Foo("") - val list: List[Foo[_]] = List(fooInt, fooString) + val list: List[Foo[?]] = List(fooInt, fooString) setFirstInList(list) // error println(fooInt.elem + 1) } diff --git a/tests/neg/i6047.scala b/tests/neg/i6047.scala index 66f4ffb8715c..da532d9c74b6 100644 --- a/tests/neg/i6047.scala +++ b/tests/neg/i6047.scala @@ -7,11 +7,11 @@ type T1[+X, Y] = Y match { // error: covariant type X appears in invariant posi case _ => String } type T2[+X, Y] = Y match { // error: covariant type X appears in invariant position - case List[_ >: X] => Int + case List[? >: X] => Int case _ => String } type T3[+X, Y] = Y match { // error: covariant type X appears in invariant position - case List[_ <: X] => Int + case List[? <: X] => Int case _ => String } type Id2[-X] = X match { // error: contravariant type X appears in invariant position @@ -23,14 +23,14 @@ type T4[-X, Y] = Y match { // error: contravariant type X appears in invariant case _ => String } type T5[-X, Y] = Y match { // error: contravariant type X appears in invariant position - case List[_ >: X] => Int + case List[? >: X] => Int case _ => String } type T6[-X, Y] = Y match { // error: contravariant type X appears in invariant position - case List[_ <: X] => Int + case List[? <: X] => Int case _ => String } type T7[-X, Y] = Y match { // error: contravariant type X appears in covariant position - case List[_] => X + case List[?] => X case _ => String } diff --git a/tests/neg/i6047a.scala b/tests/neg/i6047a.scala index 2a1bc57f604b..6cc46762d31f 100644 --- a/tests/neg/i6047a.scala +++ b/tests/neg/i6047a.scala @@ -9,11 +9,11 @@ class C[+X] { case _ => String } type T2[Y] = Y match { // error: covariant type X appears in invariant position - case List[_ >: X] => Int + case List[? >: X] => Int case _ => String } type T3[Y] = Y match { // error: covariant type X appears in invariant position - case List[_ <: X] => Int + case List[? <: X] => Int case _ => String } @@ -31,15 +31,15 @@ class D[-X] { case _ => String } type T5[Y] = Y match { // error: contravariant type X appears in invariant position - case List[_ >: X] => Int + case List[? >: X] => Int case _ => String } type T6[Y] = Y match { // error: contravariant type X appears in invariant position - case List[_ <: X] => Int + case List[? <: X] => Int case _ => String } type T7[Y] = Y match { // error: contravariant type X appears in covariant position - case List[_] => X + case List[?] => X case _ => String } } \ No newline at end of file diff --git a/tests/neg/i6724.check b/tests/neg/i6724.check index 4dd50236bbcb..0d2481ddaa2b 100644 --- a/tests/neg/i6724.check +++ b/tests/neg/i6724.check @@ -1,4 +1,4 @@ -- [E008] Not Found Error: tests/neg/i6724.scala:7:17 ------------------------------------------------------------------ -7 | def f(foo: Foo.Baz): Foo[_] = foo // error +7 | def f(foo: Foo.Baz): Foo[?] = foo // error | ^^^^^^^ | type Baz is not a member of object Foo - did you mean Foo.Bar? diff --git a/tests/neg/i6724.scala b/tests/neg/i6724.scala index 7cb4d8eddbfb..18b660e7bc0c 100644 --- a/tests/neg/i6724.scala +++ b/tests/neg/i6724.scala @@ -4,5 +4,5 @@ enum Foo[T] { } object Main { - def f(foo: Foo.Baz): Foo[_] = foo // error + def f(foo: Foo.Baz): Foo[?] = foo // error } diff --git a/tests/neg/i6815.scala b/tests/neg/i6815.scala index c07819d843d4..7a7fcc7e375d 100644 --- a/tests/neg/i6815.scala +++ b/tests/neg/i6815.scala @@ -5,7 +5,7 @@ case class Result[T](val computes : Computes[T]) def impl[T](computes : Computes[T]) : Result[T] = { val result = if ??? then { - impl(??? : Computes[_]) + impl(??? : Computes[?]) } else { Result(computes) } diff --git a/tests/neg/i7459.scala b/tests/neg/i7459.scala index a17f32b15afa..f8410fe9218e 100644 --- a/tests/neg/i7459.scala +++ b/tests/neg/i7459.scala @@ -12,7 +12,7 @@ inline def summon[T](using t:T): T = t match { case t: T => t } -inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { +inline def summonAll[T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match { case _: EmptyTuple => Nil case _: (t *: ts) => summon[Eq[t]] :: summonAll[ts] // error } @@ -26,12 +26,12 @@ object Eq { def eqv(x: Int, y: Int) = x == y } - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = { val ordx = s.ordinal(x) @@ -39,7 +39,7 @@ object Eq { } } - def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/neg/i7810.scala b/tests/neg/i7810.scala index 680514b1471e..6a543cf6a824 100644 --- a/tests/neg/i7810.scala +++ b/tests/neg/i7810.scala @@ -1 +1 @@ -val a = implicitly[ValueOf[_]] // error +val a = implicitly[ValueOf[?]] // error diff --git a/tests/neg/i7820.scala b/tests/neg/i7820.scala index 22ec8b7ac8b1..c408b4fd0f2f 100644 --- a/tests/neg/i7820.scala +++ b/tests/neg/i7820.scala @@ -1,3 +1,3 @@ -trait A1 { type F[X <: F[_, _], Y] } // error: cyclic reference involving type F +trait A1 { type F[X <: F[?, ?], Y] } // error: cyclic reference involving type F trait A2 { type F[X <: F, Y] } // error: cyclic reference involving type F // error trait A3 { type F[X >: F, Y] } // error: cyclic reference involving type F // error diff --git a/tests/neg/i8012.scala b/tests/neg/i8012.scala index c5f3df050e2c..0b31ef59d7b4 100644 --- a/tests/neg/i8012.scala +++ b/tests/neg/i8012.scala @@ -9,5 +9,5 @@ class C extends Q[?] // error: Type argument must be fully defined object O { def m(i: Int): Int = i - val x: Q[_] = m + val x: Q[?] = m } diff --git a/tests/neg/i8736.scala b/tests/neg/i8736.scala index dc2fa1821791..48a482a23b7e 100644 --- a/tests/neg/i8736.scala +++ b/tests/neg/i8736.scala @@ -13,7 +13,7 @@ object App extends App { type Rec[K <: String, V0] = Rec0[K] { def get(k: K): V0 } def field[V](s: String)(v: V): Rec[s.type, V] = Rec0(Map(s -> v)).asInstanceOf[Rec[s.type, V]] - implicit class RecOps[R <: Rec0[_]](has: R) { + implicit class RecOps[R <: Rec0[?]](has: R) { def +[K1 <: String, V1](that: Rec[K1, V1]): R with Rec[K1, V1] = Rec0(has.map ++ that.map).asInstanceOf[R with Rec[K1, V1]] } diff --git a/tests/neg/iarrays.scala b/tests/neg/iarrays.scala index 2ecd70d1e6d3..f80c24a3f3b1 100644 --- a/tests/neg/iarrays.scala +++ b/tests/neg/iarrays.scala @@ -6,7 +6,7 @@ object Test { val xs = IArray(1, 2, 3) // Can't have a wildcard IArray - val ys: IArray[_] = xs + val ys: IArray[?] = xs // Can't update an IArray xs(0) = 1 // error: value update is not a member diff --git a/tests/neg/leak-type.scala b/tests/neg/leak-type.scala index 892512c5b025..ce4a88fdf20a 100644 --- a/tests/neg/leak-type.scala +++ b/tests/neg/leak-type.scala @@ -7,7 +7,7 @@ trait A { } } class B extends A { - def foo(x: Inner[_]): Unit = { + def foo(x: Inner[?]): Unit = { val a = x.get } } diff --git a/tests/neg/matchtype-seq.check b/tests/neg/matchtype-seq.check index dbc53eaf6707..980329d585dc 100644 --- a/tests/neg/matchtype-seq.check +++ b/tests/neg/matchtype-seq.check @@ -285,7 +285,7 @@ | | longer explanation available when compiling with `-explain` -- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:109:29 ---------------------------------------------------- -109 | identity[T9[Tuple2[_, _]]]("") // error +109 | identity[T9[Tuple2[?, ?]]]("") // error | ^^ | Found: ("" : String) | Required: Test.T9[(?, ?)] @@ -302,7 +302,7 @@ | | longer explanation available when compiling with `-explain` -- [E007] Type Mismatch Error: tests/neg/matchtype-seq.scala:110:29 ---------------------------------------------------- -110 | identity[T9[Tuple2[_, _]]](1) // error +110 | identity[T9[Tuple2[?, ?]]](1) // error | ^ | Found: (1 : Int) | Required: Test.T9[(?, ?)] diff --git a/tests/neg/matchtype-seq.scala b/tests/neg/matchtype-seq.scala index 79a38fb2f5e4..2b3e5d5be90e 100644 --- a/tests/neg/matchtype-seq.scala +++ b/tests/neg/matchtype-seq.scala @@ -106,8 +106,8 @@ object Test { identity[T9[Tuple2[String, Nothing]]]("1") // error identity[T9[Tuple2[Int, Nothing]]](1) // error identity[T9[Tuple2[Nothing, Int]]]("1") // error - identity[T9[Tuple2[_, _]]]("") // error - identity[T9[Tuple2[_, _]]](1) // error + identity[T9[Tuple2[?, ?]]]("") // error + identity[T9[Tuple2[?, ?]]](1) // error identity[T9[Tuple2[Any, Any]]]("") // error identity[T9[Tuple2[Any, Any]]](1) // error @@ -147,7 +147,7 @@ object Test { object Test2 { type M[A] = A match { case Option[Int] => String - case Some[_] => Int + case Some[?] => Int } def a[A]: M[Some[A]] = 1 // error diff --git a/tests/neg/partialApplications.scala b/tests/neg/partialApplications.scala index 10cbc556ea79..3e3b28599531 100644 --- a/tests/neg/partialApplications.scala +++ b/tests/neg/partialApplications.scala @@ -1,7 +1,7 @@ object Test2 { - type Histogram = Map[_, Int] // this is now an existential type! + type Histogram = Map[?, Int] // this is now an existential type! - type StringlyHistogram = Histogram[_ >: String] // error: Test2.Histogram does not take type parameters + type StringlyHistogram = Histogram[? >: String] // error: Test2.Histogram does not take type parameters val xs: Histogram[String] = Map[String, Int]() // error: Test2.Histogram does not take type parameters diff --git a/tests/neg/shapeless-hcons.scala b/tests/neg/shapeless-hcons.scala index 701c5c35a9a3..962fb0fa07ea 100644 --- a/tests/neg/shapeless-hcons.scala +++ b/tests/neg/shapeless-hcons.scala @@ -6,7 +6,7 @@ sealed trait HList extends Product with Serializable { final case class ::[+H, +T <: HList](head : H, tail : T) extends HList { override def toString = head match { - case _: ::[_, _] => s"($head) :: $tail" + case _: ::[?, ?] => s"($head) :: $tail" case _ => s"$head :: $tail" } } diff --git a/tests/neg/t1843-variances.scala b/tests/neg/t1843-variances.scala index a6bdd686feec..b3fb3dfe0738 100644 --- a/tests/neg/t1843-variances.scala +++ b/tests/neg/t1843-variances.scala @@ -10,7 +10,7 @@ object Crash { case object IntegerUpdateType extends UpdateType[Integer] //However this method will cause a crash - def crash(updates: List[StateUpdate[_]]): Unit = { + def crash(updates: List[StateUpdate[?]]): Unit = { updates match { case Nil => case u::us => diff --git a/tests/neg/t5729.scala b/tests/neg/t5729.scala index cdee8477f7c6..6e9d4827f2fc 100644 --- a/tests/neg/t5729.scala +++ b/tests/neg/t5729.scala @@ -1,5 +1,5 @@ object C { - def join(in: Seq[List[_]]): Int = 1 + def join(in: Seq[List[?]]): Int = 1 def join[S](in: Seq[List[S]]): String = "x" val x= join(Seq[List[Int]]()) // error: ambiguous overload diff --git a/tests/neg/t9419.zio-http.scala b/tests/neg/t9419.zio-http.scala index cff9ec51e6f9..c5f341c914e3 100644 --- a/tests/neg/t9419.zio-http.scala +++ b/tests/neg/t9419.zio-http.scala @@ -2,9 +2,9 @@ import java.util.concurrent.Future as JFuture trait Test: - def shutdownGracefully(): JFuture[_] + def shutdownGracefully(): JFuture[?] - def executedWildcard(jFuture: => JFuture[_]): Unit + def executedWildcard(jFuture: => JFuture[?]): Unit def executedGeneric[A](jFuture: => JFuture[A]): Unit def executedWildGen[A](jFuture: => JFuture[? <: A]): Unit diff --git a/tests/neg/tailrec-2.scala b/tests/neg/tailrec-2.scala index b6683251f0b0..5f940ed065bc 100644 --- a/tests/neg/tailrec-2.scala +++ b/tests/neg/tailrec-2.scala @@ -2,7 +2,7 @@ import annotation.tailrec sealed abstract class Super[+A] { def f[B >: A](mem: List[B]) : List[B] - def g(mem: List[_]) = ??? + def g(mem: List[?]) = ??? } // This one should fail, target is a supertype class Bop1[+A](val element: A) extends Super[A] { diff --git a/tests/neg/type-test-syntesize-b.scala b/tests/neg/type-test-syntesize-b.scala index 79be9357387e..b5402eb92c66 100644 --- a/tests/neg/type-test-syntesize-b.scala +++ b/tests/neg/type-test-syntesize-b.scala @@ -15,7 +15,7 @@ object Test { test[Any, Int] test[Any, String] - test[Any, Some[_]] + test[Any, Some[?]] test[Any, Array[Int]] test[Seq[Int], List[Int]] diff --git a/tests/neg/type-test-syntesize.scala b/tests/neg/type-test-syntesize.scala index 86801cd8bcef..df35fdf46350 100644 --- a/tests/neg/type-test-syntesize.scala +++ b/tests/neg/type-test-syntesize.scala @@ -14,6 +14,6 @@ object Test { test[Unit, Nothing] // error test[Int, Nothing] // error test[8, Nothing] // error - test[List[_], Nothing] // error + test[List[?], Nothing] // error test[Nothing, Nothing] // error } diff --git a/tests/neg/typeclass-derivation2.scala b/tests/neg/typeclass-derivation2.scala index eca11fb326ed..dadb44353c6b 100644 --- a/tests/neg/typeclass-derivation2.scala +++ b/tests/neg/typeclass-derivation2.scala @@ -116,8 +116,8 @@ object TypeLevel { // substitute for erasedValue that allows precise matching final abstract class Type[-A, +B] - type Subtype[t] = Type[_, t] - type Supertype[t] = Type[t, _] + type Subtype[t] = Type[?, t] + type Supertype[t] = Type[t, ?] type Exactly[t] = Type[t, t] erased def typeOf[T]: Type[T, T] = compiletime.erasedValue } @@ -253,7 +253,7 @@ object Show { def show(x: T): String = inline erasedValue[S] match { case _: Shape.Cases[alts] => showCases[T, alts](ev, x) - case _: Shape.Case[_, elems] => + case _: Shape.Case[?, elems] => showCase[T, elems](ev, x) } } diff --git a/tests/neg/typeclass-encoding2.scala b/tests/neg/typeclass-encoding2.scala index d0fd4534e586..1183f5819523 100644 --- a/tests/neg/typeclass-encoding2.scala +++ b/tests/neg/typeclass-encoding2.scala @@ -21,6 +21,6 @@ object runtime1 { } implicit def inject[A, From[_]](x: From[A]) - (implicit ev: Extension1[From, _]): ev.Instance[A] { type This[X] = From[X] } = + (implicit ev: Extension1[From, ?]): ev.Instance[A] { type This[X] = From[X] } = ev.inject(x) // error: found: ev.To[A], required: ev.To[A]{This = From} } \ No newline at end of file diff --git a/tests/neg/unboundWildcard.scala b/tests/neg/unboundWildcard.scala index b137c2664925..8906377c8fa1 100644 --- a/tests/neg/unboundWildcard.scala +++ b/tests/neg/unboundWildcard.scala @@ -1,20 +1,20 @@ object unboundWildcard { - val wildcardVal: _ = 0 // error: unbound wildcard type + val wildcardVal: ? = 0 // error: unbound wildcard type - val annotated: _ @unchecked = 0 // error: unbound wildcard type + val annotated: ? @unchecked = 0 // error: unbound wildcard type - def wildcardArg(x: _): Int = 0 // error: unbound wildcard type + def wildcardArg(x: ?): Int = 0 // error: unbound wildcard type - def wildcardResult(x: Int): _ = 0 // error: unbound wildcard type + def wildcardResult(x: Int): ? = 0 // error: unbound wildcard type - val singletonTuple: (((((((_))))))) = ??? // error: unbound wildcard type + val singletonTuple: (((((((?))))))) = ??? // error: unbound wildcard type - val wildcardBoundedTypeArgL: List[_ <: _] = List(0) // error: unbound wildcard type - val wildcardBoundedTypeArgU: List[_ >: _] = List(0) // error: unbound wildcard type + val wildcardBoundedTypeArgL: List[? <: ?] = List(0) // error: unbound wildcard type + val wildcardBoundedTypeArgU: List[? >: ?] = List(0) // error: unbound wildcard type - def wildcardBoundedTypeParamL[T <: _](x: T): T = x // error: unbound wildcard type - def wildcardBoundedTypeParamU[T >: _](x: T): T = x // error: unbound wildcard type + def wildcardBoundedTypeParamL[T <: ?](x: T): T = x // error: unbound wildcard type + def wildcardBoundedTypeParamU[T >: ?](x: T): T = x // error: unbound wildcard type val _1403: (_ <: Any) = 1 // error: unbound wildcard type } diff --git a/tests/old-tasty-interpreter-prototype/interpreter/jvm/Interpreter.scala b/tests/old-tasty-interpreter-prototype/interpreter/jvm/Interpreter.scala index efb0ea248906..52d64a46da32 100644 --- a/tests/old-tasty-interpreter-prototype/interpreter/jvm/Interpreter.scala +++ b/tests/old-tasty-interpreter-prototype/interpreter/jvm/Interpreter.scala @@ -41,7 +41,7 @@ class Interpreter[Q <: Quotes & Singleton](using q0: Q) extends TreeInterpreter[ } } } - val proxyClass: Class[_] = Proxy.getProxyClass(getClass.getClassLoader, jvmReflection.loadClass(parentSymbols.fullName)) + val proxyClass: Class[?] = Proxy.getProxyClass(getClass.getClassLoader, jvmReflection.loadClass(parentSymbols.fullName)) proxyClass.getConstructor(classOf[InvocationHandler]).newInstance(handler); } } diff --git a/tests/old-tasty-interpreter-prototype/interpreter/jvm/JVMReflection.scala b/tests/old-tasty-interpreter-prototype/interpreter/jvm/JVMReflection.scala index 7d696c0e4e11..99329395d76d 100644 --- a/tests/old-tasty-interpreter-prototype/interpreter/jvm/JVMReflection.scala +++ b/tests/old-tasty-interpreter-prototype/interpreter/jvm/JVMReflection.scala @@ -23,7 +23,7 @@ class JVMReflection[Q <: Quotes & Singleton](using val q: Q) { } } - def getClassOf(sym: Symbol): Class[_] = { + def getClassOf(sym: Symbol): Class[?] = { sym.fullName match { case "scala.Boolean" => classOf[java.lang.Boolean] case "scala.Short" => classOf[java.lang.Short] @@ -36,7 +36,7 @@ class JVMReflection[Q <: Quotes & Singleton](using val q: Q) { } } - def loadClass(name: String): Class[_] = { + def loadClass(name: String): Class[?] = { try classLoader.loadClass(name) catch { case _: ClassNotFoundException => @@ -70,7 +70,7 @@ class JVMReflection[Q <: Quotes & Singleton](using val q: Q) { constr.newInstance(args*).asInstanceOf[Object] } - def getMethod(clazz: Class[_], name: String, paramClasses: List[Class[_]]): Method = { + def getMethod(clazz: Class[?], name: String, paramClasses: List[Class[?]]): Method = { try clazz.getMethod(name, paramClasses*) catch { case _: NoSuchMethodException => @@ -79,7 +79,7 @@ class JVMReflection[Q <: Quotes & Singleton](using val q: Q) { } } - private def paramsSig(sym: Symbol): List[Class[_]] = { + private def paramsSig(sym: Symbol): List[Class[?]] = { sym.signature.paramSigs.collect { case param: String => def javaArraySig(name: String): String = { diff --git a/tests/pos-custom-args/captures/matchtypes.scala b/tests/pos-custom-args/captures/matchtypes.scala index b2442277f1f7..743d84253de4 100644 --- a/tests/pos-custom-args/captures/matchtypes.scala +++ b/tests/pos-custom-args/captures/matchtypes.scala @@ -1,5 +1,5 @@ type HEAD[X <: NonEmptyTuple] = X match { - case x *: (_ <: NonEmptyTuple) => x + case x *: (? <: NonEmptyTuple) => x } inline def head[A <: NonEmptyTuple](x: A): HEAD[A] = null.asInstanceOf[HEAD[A]] diff --git a/tests/pos-deep-subtype/CollectionStrawMan1.scala b/tests/pos-deep-subtype/CollectionStrawMan1.scala index 09f0d54b0bdd..ddafb18d4254 100644 --- a/tests/pos-deep-subtype/CollectionStrawMan1.scala +++ b/tests/pos-deep-subtype/CollectionStrawMan1.scala @@ -185,7 +185,7 @@ object CollectionStrawMan1 { object ArrayBuffer extends IterableFactory[ArrayBuffer] { def fromIterator[B](it: Iterator[B]): ArrayBuffer[B] = it match { - case Iterator.Concat(fst: ArrayBufferIterator[_], snd: ArrayBufferIterator[_]) => + case Iterator.Concat(fst: ArrayBufferIterator[?], snd: ArrayBufferIterator[?]) => val elems = new Array[AnyRef](fst.remaining + snd.remaining) Array.copy(fst.elems, fst.start, elems, 0, fst.remaining) Array.copy(snd.elems, snd.start, elems, fst.remaining, snd.remaining) @@ -311,7 +311,7 @@ object CollectionStrawMan1 { /** If this iterator results from applying a transfomation to another iterator, * that other iterator, otherwise the iterator itself. */ - def underlying: Iterator[_] = this + def underlying: Iterator[?] = this /** If the number of elements still to be returned by this iterator is known, * that number, otherwise -1. diff --git a/tests/pos-deep-subtype/CollectionStrawMan4.scala b/tests/pos-deep-subtype/CollectionStrawMan4.scala index 5ca8a978c4fd..f3439e79dd24 100644 --- a/tests/pos-deep-subtype/CollectionStrawMan4.scala +++ b/tests/pos-deep-subtype/CollectionStrawMan4.scala @@ -415,7 +415,7 @@ object CollectionStrawMan4 { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -424,7 +424,7 @@ object CollectionStrawMan4 { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/pos-deep-subtype/CollectionStrawMan5.scala b/tests/pos-deep-subtype/CollectionStrawMan5.scala index 52c5f3baa2e1..bea1dd3016d0 100644 --- a/tests/pos-deep-subtype/CollectionStrawMan5.scala +++ b/tests/pos-deep-subtype/CollectionStrawMan5.scala @@ -406,7 +406,7 @@ object CollectionStrawMan5 { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -415,7 +415,7 @@ object CollectionStrawMan5 { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/pos-deep-subtype/CollectionStrawMan6.scala b/tests/pos-deep-subtype/CollectionStrawMan6.scala index 9f189afbcf3a..7e8a46e98c7d 100644 --- a/tests/pos-deep-subtype/CollectionStrawMan6.scala +++ b/tests/pos-deep-subtype/CollectionStrawMan6.scala @@ -865,7 +865,7 @@ object CollectionStrawMan6 extends LowPriority { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownSize = other match { - case other: Iterable[_] if underlying.knownSize >= 0 && other.knownSize >= 0 => + case other: Iterable[?] if underlying.knownSize >= 0 && other.knownSize >= 0 => underlying.knownSize + other.knownSize case _ => -1 @@ -878,7 +878,7 @@ object CollectionStrawMan6 extends LowPriority { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownSize = other match { - case other: Iterable[_] if underlying.knownSize >= 0 && other.knownSize >= 0 => + case other: Iterable[?] if underlying.knownSize >= 0 && other.knownSize >= 0 => underlying.knownSize min other.knownSize case _ => -1 diff --git a/tests/pos-deep-subtype/i9631.scala b/tests/pos-deep-subtype/i9631.scala index 5806bda33b4f..c91216b1acc3 100644 --- a/tests/pos-deep-subtype/i9631.scala +++ b/tests/pos-deep-subtype/i9631.scala @@ -6,8 +6,8 @@ object SkipList { sealed trait SkipList[T <: Txn[T], A, E] object HASkipList { - def debug[T <: Txn[T], A](in: SkipList[T, A, _], key: A)(implicit tx: T): Int = in match { - case impl: Impl[T, A, _] => impl.foo(key) + def debug[T <: Txn[T], A](in: SkipList[T, A, ?], key: A)(implicit tx: T): Int = in match { + case impl: Impl[T, A, ?] => impl.foo(key) case _ => -1 } diff --git a/tests/pos-deep-subtype/inductive-implicits-bench.scala b/tests/pos-deep-subtype/inductive-implicits-bench.scala index aff8bffd8024..46bca8920ff6 100644 --- a/tests/pos-deep-subtype/inductive-implicits-bench.scala +++ b/tests/pos-deep-subtype/inductive-implicits-bench.scala @@ -21,7 +21,7 @@ package shapeless { def ::[HH](h : HH) : HH :: H :: T = shapeless.::(h, this) override def toString = head match { - case _: ::[_, _] => "("+head.toString+") :: "+tail.toString + case _: ::[?, ?] => "("+head.toString+") :: "+tail.toString case _ => head.toString+" :: "+tail.toString } } diff --git a/tests/pos-java-interop-separate/i3273/client_2.scala b/tests/pos-java-interop-separate/i3273/client_2.scala index a11f17f5ed8a..5f52ff17bb1d 100644 --- a/tests/pos-java-interop-separate/i3273/client_2.scala +++ b/tests/pos-java-interop-separate/i3273/client_2.scala @@ -1,5 +1,5 @@ class Client { val a = (_: Bar_1.A[AnyRef]).foo() val b = (_: Bar_1.B[AnyRef]).bar() - def test(x: Bar_1.A[AnyRef]): Bar_1.B[_] = x + def test(x: Bar_1.A[AnyRef]): Bar_1.B[?] = x } diff --git a/tests/pos-java-interop-separate/t11469_2/Test_2.scala b/tests/pos-java-interop-separate/t11469_2/Test_2.scala index 296d2d02af39..94ac5cf6cbd1 100644 --- a/tests/pos-java-interop-separate/t11469_2/Test_2.scala +++ b/tests/pos-java-interop-separate/t11469_2/Test_2.scala @@ -2,10 +2,10 @@ class A { new Test_1.B() { } new Test_1.B() { - override def m(a: java.util.Optional[_ <: Object]): Unit = { } + override def m(a: java.util.Optional[? <: Object]): Unit = { } } new Test_1.B() { - override def m(a: java.util.Optional[_]): Unit = { } + override def m(a: java.util.Optional[?]): Unit = { } } } diff --git a/tests/pos-java-interop/t2940/Error.scala b/tests/pos-java-interop/t2940/Error.scala index 305d8aa4c95e..5f4efc233505 100644 --- a/tests/pos-java-interop/t2940/Error.scala +++ b/tests/pos-java-interop/t2940/Error.scala @@ -1,5 +1,5 @@ abstract class Error { - val c: Cycle[_] + val c: Cycle[?] } object Test { diff --git a/tests/pos-macros/asExprOf.scala b/tests/pos-macros/asExprOf.scala index 5d0be15227a0..f5e99251729e 100644 --- a/tests/pos-macros/asExprOf.scala +++ b/tests/pos-macros/asExprOf.scala @@ -1,6 +1,6 @@ import scala.quoted.* -def test(using Quotes)(x: Expr[_]) = { +def test(using Quotes)(x: Expr[?]) = { import quotes.reflect.* x.asTerm.asExprOf[Any] } diff --git a/tests/pos-macros/i10864/Macro_1.scala b/tests/pos-macros/i10864/Macro_1.scala index 7cf1e1850a76..fcd376f9e592 100644 --- a/tests/pos-macros/i10864/Macro_1.scala +++ b/tests/pos-macros/i10864/Macro_1.scala @@ -1,6 +1,6 @@ import scala.quoted._ -case class T(t: Type[_]) +case class T(t: Type[?]) object T { def impl[T <: AnyKind](using tt: Type[T])(using Quotes): Expr[Unit] = { diff --git a/tests/pos-macros/i10864a/Macro_1.scala b/tests/pos-macros/i10864a/Macro_1.scala index d1d5302544b4..b0c953901816 100644 --- a/tests/pos-macros/i10864a/Macro_1.scala +++ b/tests/pos-macros/i10864a/Macro_1.scala @@ -1,6 +1,6 @@ import scala.quoted._ -case class T(t: Type[_]) +case class T(t: Type[?]) object T { def impl[T <: AnyKind](using tt: Type[T])(using Quotes): Expr[Unit] = { diff --git a/tests/pos-macros/i14536b/Macro_1.scala b/tests/pos-macros/i14536b/Macro_1.scala index 332c6ca77595..d07bc343d690 100644 --- a/tests/pos-macros/i14536b/Macro_1.scala +++ b/tests/pos-macros/i14536b/Macro_1.scala @@ -20,7 +20,7 @@ given FromExpr[Error] with { } } -private def assertCompilesImpl(self: Expr[_], typeChecked: Expr[List[Error]])(using Quotes): Expr[Unit] = { +private def assertCompilesImpl(self: Expr[?], typeChecked: Expr[List[Error]])(using Quotes): Expr[Unit] = { import quotes.reflect._ def checkCompile(code: String): Expr[Unit] = { diff --git a/tests/pos-macros/i17434a/Macro.scala b/tests/pos-macros/i17434a/Macro.scala index 0e399d82a9d1..dac7435a015a 100644 --- a/tests/pos-macros/i17434a/Macro.scala +++ b/tests/pos-macros/i17434a/Macro.scala @@ -2,7 +2,7 @@ import scala.quoted.* object SelectDynamicMacroImpl { def selectImpl[E: Type]( - ref: Expr[SQLSyntaxProvider[_]], + ref: Expr[SQLSyntaxProvider[?]], name: Expr[String] )(using Quotes): Expr[SQLSyntax] = '{SQLSyntax("foo")} } diff --git a/tests/pos-macros/i17434d/Macro.scala b/tests/pos-macros/i17434d/Macro.scala index a76c8aab58e4..ce47c547d593 100644 --- a/tests/pos-macros/i17434d/Macro.scala +++ b/tests/pos-macros/i17434d/Macro.scala @@ -1,2 +1,2 @@ import scala.quoted.* -def impl[E: Type](ref: Expr[Foo[_]])(using Quotes): Expr[Unit] = '{ } +def impl[E: Type](ref: Expr[Foo[?]])(using Quotes): Expr[Unit] = '{ } diff --git a/tests/pos-macros/i8651b.scala b/tests/pos-macros/i8651b.scala index 31d73271ff40..00c8d99d1d55 100644 --- a/tests/pos-macros/i8651b.scala +++ b/tests/pos-macros/i8651b.scala @@ -8,7 +8,7 @@ object Macros { inline def coroutine[T](inline body: Any): Coroutine[T] = ${ coroutineImpl('{body}) } - def coroutineImpl[T: Type](expr: Expr[_ <: Any])(using Quotes): Expr[Coroutine[T]] = { + def coroutineImpl[T: Type](expr: Expr[? <: Any])(using Quotes): Expr[Coroutine[T]] = { import quotes.reflect.* '{ diff --git a/tests/pos-special/stdlib/collection/IndexedSeq.scala b/tests/pos-special/stdlib/collection/IndexedSeq.scala index 6e8e2bd0dc66..486360902ac9 100644 --- a/tests/pos-special/stdlib/collection/IndexedSeq.scala +++ b/tests/pos-special/stdlib/collection/IndexedSeq.scala @@ -37,12 +37,12 @@ trait IndexedSeqOps[+A, +CC[_], +C] extends Any with SeqOps[A, CC, C] { self => def iterator: Iterator[A] = view.iterator - override def stepper[S <: Stepper[_]](implicit shape: StepperShape[A, S]): S with EfficientSplit = { + override def stepper[S <: Stepper[?]](implicit shape: StepperShape[A, S]): S with EfficientSplit = { import convert.impl._ val s = shape.shape match { - case StepperShape.IntShape => new IntIndexedSeqStepper (this.asInstanceOf[IndexedSeqOps[Int, AnyConstr, _]], 0, length) - case StepperShape.LongShape => new LongIndexedSeqStepper (this.asInstanceOf[IndexedSeqOps[Long, AnyConstr, _]], 0, length) - case StepperShape.DoubleShape => new DoubleIndexedSeqStepper(this.asInstanceOf[IndexedSeqOps[Double, AnyConstr, _]], 0, length) + case StepperShape.IntShape => new IntIndexedSeqStepper (this.asInstanceOf[IndexedSeqOps[Int, AnyConstr, ?]], 0, length) + case StepperShape.LongShape => new LongIndexedSeqStepper (this.asInstanceOf[IndexedSeqOps[Long, AnyConstr, ?]], 0, length) + case StepperShape.DoubleShape => new DoubleIndexedSeqStepper(this.asInstanceOf[IndexedSeqOps[Double, AnyConstr, ?]], 0, length) case _ => shape.parUnbox(new AnyIndexedSeqStepper[A](this, 0, length)) } s.asInstanceOf[S with EfficientSplit] @@ -104,7 +104,7 @@ trait IndexedSeqOps[+A, +CC[_], +C] extends Any with SeqOps[A, CC, C] { self => override def knownSize: Int = length - override final def lengthCompare(that: Iterable[_]^): Int = { + override final def lengthCompare(that: Iterable[?]^): Int = { val res = that.sizeCompare(length) // can't just invert the result, because `-Int.MinValue == Int.MinValue` if (res == Int.MinValue) 1 else -res diff --git a/tests/pos-special/stdlib/collection/Iterable.scala b/tests/pos-special/stdlib/collection/Iterable.scala index 85c0debc6685..6488c99e04df 100644 --- a/tests/pos-special/stdlib/collection/Iterable.scala +++ b/tests/pos-special/stdlib/collection/Iterable.scala @@ -321,7 +321,7 @@ trait IterableOps[+A, +CC[_], +C] extends Any with IterableOnce[A] with Iterable * is `O(this.size min that.size)` instead of `O(this.size + that.size)`. * The method should be overridden if computing `size` is cheap and `knownSize` returns `-1`. */ - def sizeCompare(that: Iterable[_]^): Int = { + def sizeCompare(that: Iterable[?]^): Int = { val thatKnownSize = that.knownSize if (thatKnownSize >= 0) this sizeCompare thatKnownSize @@ -869,7 +869,7 @@ object IterableOps { * These operations are implemented in terms of * [[scala.collection.IterableOps.sizeCompare(Int) `sizeCompare(Int)`]]. */ - final class SizeCompareOps private[collection](val it: IterableOps[_, AnyConstr, _]^) extends AnyVal { + final class SizeCompareOps private[collection](val it: IterableOps[?, AnyConstr, ?]^) extends AnyVal { this: SizeCompareOps^{it} => /** Tests if the size of the collection is less than some value. */ @inline def <(size: Int): Boolean = it.sizeCompare(size) < 0 @@ -895,7 +895,7 @@ object IterableOps { */ @SerialVersionUID(3L) class WithFilter[+A, +CC[_]]( - self: IterableOps[A, CC, _]^, + self: IterableOps[A, CC, ?]^, p: A => Boolean ) extends collection.WithFilter[A, CC] with Serializable { @@ -986,7 +986,7 @@ trait EvidenceIterableFactoryDefaults[+A, +CC[x] <: IterableOps[x, CC, CC[x]], E trait SortedSetFactoryDefaults[+A, +CC[X] <: SortedSet[X] with SortedSetOps[X, CC, CC[X]], +WithFilterCC[x] <: IterableOps[x, WithFilterCC, WithFilterCC[x]] with Set[x]] extends SortedSetOps[A @uncheckedVariance, CC, CC[A @uncheckedVariance]] { - self: IterableOps[A, WithFilterCC, _] => + self: IterableOps[A, WithFilterCC, ?] => override protected def fromSpecific(coll: IterableOnce[A @uncheckedVariance]^): CC[A @uncheckedVariance]^{coll} = sortedIterableFactory.from(coll)(ordering) override protected def newSpecificBuilder: mutable.Builder[A @uncheckedVariance, CC[A @uncheckedVariance]] = sortedIterableFactory.newBuilder[A](ordering) @@ -1017,7 +1017,7 @@ trait MapFactoryDefaults[K, +V, override protected def newSpecificBuilder: mutable.Builder[(K, V @uncheckedVariance), CC[K, V @uncheckedVariance]] = mapFactory.newBuilder[K, V] override def empty: CC[K, V @uncheckedVariance] = (this: AnyRef) match { // Implemented here instead of in TreeSeqMap since overriding empty in TreeSeqMap is not forwards compatible (should be moved) - case self: immutable.TreeSeqMap[_, _] => immutable.TreeSeqMap.empty(self.orderedBy).asInstanceOf[CC[K, V]] + case self: immutable.TreeSeqMap[?, ?] => immutable.TreeSeqMap.empty(self.orderedBy).asInstanceOf[CC[K, V]] case _ => mapFactory.empty } @@ -1041,7 +1041,7 @@ trait SortedMapFactoryDefaults[K, +V, +CC[x, y] <: Map[x, y] with SortedMapOps[x, y, CC, CC[x, y]] with UnsortedCC[x, y], +WithFilterCC[x] <: IterableOps[x, WithFilterCC, WithFilterCC[x]] with Iterable[x], +UnsortedCC[x, y] <: Map[x, y]] extends SortedMapOps[K, V, CC, CC[K, V @uncheckedVariance]] with MapOps[K, V, UnsortedCC, CC[K, V @uncheckedVariance]] { - self: IterableOps[(K, V), WithFilterCC, _] => + self: IterableOps[(K, V), WithFilterCC, ?] => override def empty: CC[K, V @uncheckedVariance] = sortedMapFactory.empty(ordering) override protected def fromSpecific(coll: IterableOnce[(K, V @uncheckedVariance)]^): CC[K, V @uncheckedVariance]^{coll} = sortedMapFactory.from(coll)(ordering) diff --git a/tests/pos-special/stdlib/collection/IterableOnce.scala b/tests/pos-special/stdlib/collection/IterableOnce.scala index 6836a3bac39a..fe662d9db957 100644 --- a/tests/pos-special/stdlib/collection/IterableOnce.scala +++ b/tests/pos-special/stdlib/collection/IterableOnce.scala @@ -68,7 +68,7 @@ trait IterableOnce[+A] extends Any { * allow creating parallel streams, whereas bare Steppers can be converted only to sequential * streams. */ - def stepper[S <: Stepper[_]^{this}](implicit shape: StepperShape[A, S]): S = { + def stepper[S <: Stepper[?]^{this}](implicit shape: StepperShape[A, S]): S = { import convert.impl._ val s: Any = shape.shape match { case StepperShape.IntShape => new IntIteratorStepper (iterator.asInstanceOf[Iterator[Int]]) diff --git a/tests/pos-special/stdlib/collection/Iterator.scala b/tests/pos-special/stdlib/collection/Iterator.scala index ecd8d985bbf0..a12da598e7e6 100644 --- a/tests/pos-special/stdlib/collection/Iterator.scala +++ b/tests/pos-special/stdlib/collection/Iterator.scala @@ -1160,7 +1160,7 @@ object Iterator extends IterableFactory[Iterator] { else { // If we advanced the current iterator to a ConcatIterator, merge it into this one @tailrec def merge(): Unit = - if (current.isInstanceOf[ConcatIterator[_]]) { + if (current.isInstanceOf[ConcatIterator[?]]) { val c = current.asInstanceOf[ConcatIterator[A]] current = c.current currentHasNextChecked = c.currentHasNextChecked diff --git a/tests/pos-special/stdlib/collection/LinearSeq.scala b/tests/pos-special/stdlib/collection/LinearSeq.scala index 393f5fda4187..59d9eb30ca93 100644 --- a/tests/pos-special/stdlib/collection/LinearSeq.scala +++ b/tests/pos-special/stdlib/collection/LinearSeq.scala @@ -97,12 +97,12 @@ trait LinearSeqOps[+A, +CC[X] <: LinearSeq[X], +C <: LinearSeq[A] with LinearSeq else loop(0, coll) } - override def lengthCompare(that: Iterable[_]^): Int = { + override def lengthCompare(that: Iterable[?]^): Int = { val thatKnownSize = that.knownSize if (thatKnownSize >= 0) this lengthCompare thatKnownSize else that match { - case that: LinearSeq[_] => + case that: LinearSeq[?] => var thisSeq = this var thatSeq = that while (thisSeq.nonEmpty && thatSeq.nonEmpty) { diff --git a/tests/pos-special/stdlib/collection/Map.scala b/tests/pos-special/stdlib/collection/Map.scala index ef4f915ea573..2354e5a75e43 100644 --- a/tests/pos-special/stdlib/collection/Map.scala +++ b/tests/pos-special/stdlib/collection/Map.scala @@ -63,7 +63,7 @@ trait Map[K, +V] */ override def equals(o: Any): Boolean = (this eq o.asInstanceOf[AnyRef]) || (o match { - case map: Map[K @unchecked, _] if map.canEqual(this) => + case map: Map[K @unchecked, ?] if map.canEqual(this) => (this.size == map.size) && { try this.forall(kv => map.getOrElse(kv._1, Map.DefaultSentinelFn()) == kv._2) catch { case _: ClassCastException => false } // PR #9565 / scala/bug#12228 @@ -99,14 +99,14 @@ trait Map[K, +V] */ // Note: the upper bound constraint on CC is useful only to // erase CC to IterableOps instead of Object -trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C] +trait MapOps[K, +V, +CC[_, _] <: IterableOps[?, AnyConstr, ?], +C] extends IterableOps[(K, V), Iterable, C] with PartialFunction[K, V] { override def view: MapView[K, V] = new MapView.Id(this) /** Returns a [[Stepper]] for the keys of this map. See method [[stepper]]. */ - def keyStepper[S <: Stepper[_]](implicit shape: StepperShape[K, S]): S = { + def keyStepper[S <: Stepper[?]](implicit shape: StepperShape[K, S]): S = { import convert.impl._ val s = shape.shape match { case StepperShape.IntShape => new IntIteratorStepper (keysIterator.asInstanceOf[Iterator[Int]]) @@ -118,7 +118,7 @@ trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C] } /** Returns a [[Stepper]] for the values of this map. See method [[stepper]]. */ - def valueStepper[S <: Stepper[_]](implicit shape: StepperShape[V, S]): S = { + def valueStepper[S <: Stepper[?]](implicit shape: StepperShape[V, S]): S = { import convert.impl._ val s = shape.shape match { case StepperShape.IntShape => new IntIteratorStepper (valuesIterator.asInstanceOf[Iterator[Int]]) @@ -373,8 +373,8 @@ object MapOps { * @define coll map collection */ @SerialVersionUID(3L) - class WithFilter[K, +V, +IterableCC[_], +CC[_, _] <: IterableOps[_, AnyConstr, _]]( - self: MapOps[K, V, CC, _] with IterableOps[(K, V), IterableCC, _], + class WithFilter[K, +V, +IterableCC[_], +CC[_, _] <: IterableOps[?, AnyConstr, ?]]( + self: MapOps[K, V, CC, ?] with IterableOps[(K, V), IterableCC, ?], p: ((K, V)) => Boolean ) extends IterableOps.WithFilter[(K, V), IterableCC](self, p) with Serializable { diff --git a/tests/pos-special/stdlib/collection/Seq.scala b/tests/pos-special/stdlib/collection/Seq.scala index caabf6fa6436..67a08fd9f691 100644 --- a/tests/pos-special/stdlib/collection/Seq.scala +++ b/tests/pos-special/stdlib/collection/Seq.scala @@ -813,7 +813,7 @@ trait SeqOps[+A, +CC[_], +C] extends Any with IterableOps[A, CC, C] { self => */ def lengthCompare(len: Int): Int = super.sizeCompare(len) - override final def sizeCompare(that: Iterable[_]^): Int = lengthCompare(that) + override final def sizeCompare(that: Iterable[?]^): Int = lengthCompare(that) /** Compares the length of this $coll to the size of another `Iterable`. * @@ -828,7 +828,7 @@ trait SeqOps[+A, +CC[_], +C] extends Any with IterableOps[A, CC, C] { self => * is `O(this.length min that.size)` instead of `O(this.length + that.size)`. * The method should be overridden if computing `size` is cheap and `knownSize` returns `-1`. */ - def lengthCompare(that: Iterable[_]^): Int = super.sizeCompare(that) + def lengthCompare(that: Iterable[?]^): Int = super.sizeCompare(that) /** Returns a value class containing operations for comparing the length of this $coll to a test value. * @@ -1067,7 +1067,7 @@ object SeqOps { } // Now we know we actually need KMP search, so do it else S match { - case xs: scala.collection.IndexedSeq[_] => + case xs: scala.collection.IndexedSeq[?] => // We can index into S directly; it should be adequately fast val Wopt = kmpOptimizeWord(W, n0, n1, forward) val T = kmpJumpTable(Wopt, n1-n0) diff --git a/tests/pos-special/stdlib/collection/View.scala b/tests/pos-special/stdlib/collection/View.scala index 85910311a4c3..becea5032ea8 100644 --- a/tests/pos-special/stdlib/collection/View.scala +++ b/tests/pos-special/stdlib/collection/View.scala @@ -139,7 +139,7 @@ object View extends IterableFactory[View] { } /** An `IterableOps` whose collection type and collection type constructor are unknown */ - type SomeIterableOps[A] = IterableOps[A, AnyConstr, _] + type SomeIterableOps[A] = IterableOps[A, AnyConstr, ?] /** A view that filters an underlying collection. */ @SerialVersionUID(3L) diff --git a/tests/pos-special/stdlib/collection/immutable/List.scala b/tests/pos-special/stdlib/collection/immutable/List.scala index 6a305f4ebdec..110fc0cbd53f 100644 --- a/tests/pos-special/stdlib/collection/immutable/List.scala +++ b/tests/pos-special/stdlib/collection/immutable/List.scala @@ -597,7 +597,7 @@ sealed abstract class List[+A] // Override for performance override def equals(o: scala.Any): Boolean = { - @tailrec def listEq(a: List[_], b: List[_]): Boolean = + @tailrec def listEq(a: List[?], b: List[?]): Boolean = (a eq b) || { val aEmpty = a.isEmpty val bEmpty = b.isEmpty @@ -610,7 +610,7 @@ sealed abstract class List[+A] } o match { - case that: List[_] => listEq(this, that) + case that: List[?] => listEq(this, that) case _ => super.equals(o) } } diff --git a/tests/pos-special/stdlib/collection/immutable/Seq.scala b/tests/pos-special/stdlib/collection/immutable/Seq.scala index 5184cadaccae..7fb4d065b7bf 100644 --- a/tests/pos-special/stdlib/collection/immutable/Seq.scala +++ b/tests/pos-special/stdlib/collection/immutable/Seq.scala @@ -54,13 +54,13 @@ trait IndexedSeq[+A] extends Seq[A] final override def toIndexedSeq: IndexedSeq[A] = this override def canEqual(that: Any): Boolean = that match { - case otherIndexedSeq: IndexedSeq[_] => length == otherIndexedSeq.length && super.canEqual(that) + case otherIndexedSeq: IndexedSeq[?] => length == otherIndexedSeq.length && super.canEqual(that) case _ => super.canEqual(that) } override def sameElements[B >: A](o: IterableOnce[B]^): Boolean = o match { - case that: IndexedSeq[_] => + case that: IndexedSeq[?] => (this eq that) || { val length = this.length var equal = length == that.length diff --git a/tests/pos-special/stdlib/collection/mutable/Builder.scala b/tests/pos-special/stdlib/collection/mutable/Builder.scala index dd57cb75da91..908215a30428 100644 --- a/tests/pos-special/stdlib/collection/mutable/Builder.scala +++ b/tests/pos-special/stdlib/collection/mutable/Builder.scala @@ -55,7 +55,7 @@ trait Builder[-A, +To] extends Growable[A] { * @param coll the collection which serves as a hint for the result's size. * @param delta a correction to add to the `coll.size` to produce the size hint. */ - final def sizeHint(coll: scala.collection.IterableOnce[_]^, delta: Int = 0): Unit = { + final def sizeHint(coll: scala.collection.IterableOnce[?]^, delta: Int = 0): Unit = { val s = coll.knownSize if (s != -1) sizeHint(s + delta) } @@ -73,7 +73,7 @@ trait Builder[-A, +To] extends Growable[A] { * than collection's size are reduced. */ // should probably be `boundingColl: IterableOnce[_]`, but binary compatibility - final def sizeHintBounded(size: Int, boundingColl: scala.collection.Iterable[_]^): Unit = { + final def sizeHintBounded(size: Int, boundingColl: scala.collection.Iterable[?]^): Unit = { val s = boundingColl.knownSize if (s != -1) { sizeHint(scala.math.min(s, size)) diff --git a/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala b/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala index 5024f2f9e366..bdfa995e6a12 100644 --- a/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala +++ b/tests/pos-with-compiler-cc/dotc/parsing/Parsers.scala @@ -1732,7 +1732,7 @@ object Parsers { else if sourceVersion.isAtLeast(future) then deprecationWarning(em"`_` is deprecated for wildcard arguments of types: use `?` instead") - patch(source, Span(in.offset, in.offset + 1), "?") + patch(source, Span(in.offset, in.offset + 1), "?") val start = in.skipToken() typeBounds().withSpan(Span(start, in.lastOffset, start)) // Allow symbols -_ and +_ through for compatibility with code written using kind-projector in Scala 3 underscore mode. diff --git a/tests/pos-with-compiler/Patterns.scala b/tests/pos-with-compiler/Patterns.scala index 6492ce6f8c72..e3fbb9bd3b99 100644 --- a/tests/pos-with-compiler/Patterns.scala +++ b/tests/pos-with-compiler/Patterns.scala @@ -97,8 +97,8 @@ object Patterns { class caseWithPatternVariableHelper2[A] def caseWithPatternVariable(x: Any) = x match { - case a: caseWithPatternVariableHelper1[_] => () - case b: caseWithPatternVariableHelper2[_] => () + case a: caseWithPatternVariableHelper1[?] => () + case b: caseWithPatternVariableHelper2[?] => () } } diff --git a/tests/pos-with-compiler/tasty/test-definitions.scala b/tests/pos-with-compiler/tasty/test-definitions.scala index f2b6232a8d5e..c1fe97cc1d26 100644 --- a/tests/pos-with-compiler/tasty/test-definitions.scala +++ b/tests/pos-with-compiler/tasty/test-definitions.scala @@ -148,7 +148,7 @@ object definitions { case class AndType(left: Type, right: Type) extends Type case class OrType(left: Type, right: Type) extends Type case class ByNameType(underlying: Type) extends Type - case class ParamRef(binder: LambdaType[_, _], idx: Int) extends Type + case class ParamRef(binder: LambdaType[?, ?], idx: Int) extends Type case class ThisType(tp: Type) extends Type case class RecursiveThis(binder: RecursiveType) extends Type diff --git a/tests/pos/13469.scala b/tests/pos/13469.scala index 7e4238373a4f..0d9bb96dccc8 100644 --- a/tests/pos/13469.scala +++ b/tests/pos/13469.scala @@ -11,7 +11,7 @@ object Meta: type Contains[T <: Tuple, X] <: Boolean = T match case X *: r => true - case _ *: r => Contains[r, X] + case ? *: r => Contains[r, X] case _ => false type RemoveStrict[T <: Tuple, X] <: Tuple = T match diff --git a/tests/pos/13491.scala b/tests/pos/13491.scala index d764494c6048..88a0cc7bcd4a 100644 --- a/tests/pos/13491.scala +++ b/tests/pos/13491.scala @@ -57,12 +57,12 @@ object TailSwitch { case T => Prepend0[Reverse1[RI], R] case HNil => TI match { - case ::[_, t] => TailSwitch0[L, HNil, T, t, R, RI] + case ::[?, t] => TailSwitch0[L, HNil, T, t, R, RI] } case ::[h, t] => TI match { case HNil => TailSwitch0[L, t, T, HNil, R, h :: RI] - case ::[_, tt] => TailSwitch0[L, t, T, tt, R, h :: RI] + case ::[?, tt] => TailSwitch0[L, t, T, tt, R, h :: RI] } } } diff --git a/tests/pos/8647.scala b/tests/pos/8647.scala index 5e8f839b27ca..d0659648349f 100644 --- a/tests/pos/8647.scala +++ b/tests/pos/8647.scala @@ -7,9 +7,9 @@ final class Bla[X] object Test1 { type Foo[X] = X match - case Two[Blaaa, _] => + case Two[Blaaa, ?] => String - case Two[String, _] => + case Two[String, ?] => Int def test: Foo[Two[String, String]] = 1 @@ -17,9 +17,9 @@ object Test1 { object Test2 { type Foo[X] = X match - case Two[Bla[_], _] => + case Two[Bla[?], ?] => String - case Two[String, _] => + case Two[String, ?] => Int def test: Foo[Two[String, String]] = 1 @@ -32,7 +32,7 @@ object Test3 { type M[X, Y] = X match { case Int => String case Id[x] => Y match { - case Two[Bla[a], _] => Int + case Two[Bla[a], ?] => Int case _ => String } } @@ -45,7 +45,7 @@ object Test4 { type M[X, Y] = X match { case Int => String case Id[x] => Y match { - case Two[Bla[`x`], _] => Int + case Two[Bla[`x`], ?] => Int case _ => String } } diff --git a/tests/pos/8649.scala b/tests/pos/8649.scala index 7e0351d52628..3fe7e3eb6582 100644 --- a/tests/pos/8649.scala +++ b/tests/pos/8649.scala @@ -16,7 +16,7 @@ object handler: HandlerSingle[API] type HandlerSingle[X] = X match - case OK[_, response] => + case OK[?, response] => IO[response] object Minimized { diff --git a/tests/pos/9675.scala b/tests/pos/9675.scala index 63f01cf73a2f..35aebe9b10ff 100644 --- a/tests/pos/9675.scala +++ b/tests/pos/9675.scala @@ -5,8 +5,8 @@ sealed trait TNil extends TList sealed trait ++:[H[_], T <: TList] extends TList type IndexOf[H[_], T <: TList] <: Int = T match - case H ++: _ => 0 - case _ ++: t => S[IndexOf[H, t]] + case H ++: ? => 0 + case ? ++: t => S[IndexOf[H, t]] // compiles fine val a = summon[ValueOf[IndexOf[List, List ++: Option ++: TNil]]].value diff --git a/tests/pos/9871.scala b/tests/pos/9871.scala index e5e2a9aded4c..7d9c0a77e692 100644 --- a/tests/pos/9871.scala +++ b/tests/pos/9871.scala @@ -2,7 +2,7 @@ object Test { type IsTypeInTuple[T, Tup <: Tuple] = Tup match { case EmptyTuple => false case T *: ts => true - case _ *: ts => IsTypeInTuple[T, ts] + case ? *: ts => IsTypeInTuple[T, ts] } summon[(Int *: String *: EmptyTuple) =:= (Int, String)] //they are the same summon[IsTypeInTuple[String, Int *: String *: EmptyTuple] =:= true] //compiles diff --git a/tests/pos/AE-9a131723f09b9f77c99c52b709965e580a61706e.scala b/tests/pos/AE-9a131723f09b9f77c99c52b709965e580a61706e.scala index 76c0c3d731e9..69340e5c39a8 100755 --- a/tests/pos/AE-9a131723f09b9f77c99c52b709965e580a61706e.scala +++ b/tests/pos/AE-9a131723f09b9f77c99c52b709965e580a61706e.scala @@ -1 +1 @@ -object I0 { val i1: PartialFunction[_, Any] = { case i2 => i2 } } +object I0 { val i1: PartialFunction[?, Any] = { case i2 => i2 } } diff --git a/tests/pos/Repeated.scala b/tests/pos/Repeated.scala index 058edba2d174..2dcf9ec97c43 100644 --- a/tests/pos/Repeated.scala +++ b/tests/pos/Repeated.scala @@ -119,7 +119,7 @@ object Repeated: def segmentLength(p: (A) => Boolean, from: Int): Int = xs.segmentLength(p, from) def segmentLength(p: (A) => Boolean): Int = xs.segmentLength(p) def size: Int = xs.size - def sizeCompare(that: Iterable[_]): Int = xs.sizeCompare(that) + def sizeCompare(that: Iterable[?]): Int = xs.sizeCompare(that) def sizeCompare(otherSize: Int): Int = xs.sizeCompare(otherSize) def sizeIs: SizeCompareOps = xs.sizeIs def slice(from: Int, until: Int): Repeated[A] = xs.slice(from, until) @@ -130,7 +130,7 @@ object Repeated: def span(p: A => Boolean): (Repeated[A], Repeated[A]) = xs.span(p) def splitAt(n: Int): (Repeated[A], Repeated[A]) = xs.splitAt(n) def startsWith[B >: A](that: IterableOnce[B], offset: Int): Boolean = xs.startsWith(that, offset) - def stepper[S <: Stepper[_]](using StepperShape[A, S]): S = xs.stepper[S] + def stepper[S <: Stepper[?]](using StepperShape[A, S]): S = xs.stepper[S] def sum[B >: A](using math.Numeric[B]): B = xs.sum[B] def tail: Repeated[A] = xs.tail def tails: Iterator[Repeated[A]] = xs.tails diff --git a/tests/pos/annotations1/a.scala b/tests/pos/annotations1/a.scala index 8d0df5a2cac5..e87fa83f8a50 100644 --- a/tests/pos/annotations1/a.scala +++ b/tests/pos/annotations1/a.scala @@ -1,2 +1,2 @@ class Annot1(s: String) extends scala.annotation.StaticAnnotation -class Annot2(s: Class[_]) extends scala.annotation.StaticAnnotation +class Annot2(s: Class[?]) extends scala.annotation.StaticAnnotation diff --git a/tests/pos/approximateUnion.scala b/tests/pos/approximateUnion.scala index d23c3ca0ee04..ba91465e14bc 100644 --- a/tests/pos/approximateUnion.scala +++ b/tests/pos/approximateUnion.scala @@ -45,8 +45,8 @@ object approximateUnion2 { val x = if (coin) new A{} else new B{} val y = Some(if (coin) new A{} else new B{}) - val xtest: C[_ >: A & B <: A | B] & D = x - val ytest: Some[C[_ >: A & B <: A | B] & D] = y + val xtest: C[? >: A & B <: A | B] & D = x + val ytest: Some[C[? >: A & B <: A | B] & D] = y } { @@ -57,8 +57,8 @@ object approximateUnion2 { val x = if (coin) new A{} else new B{} val y = Some(if (coin) new A{} else new B{}) - val xtest: C[_ >: X[A | B] <: X[A & B]] & D = x - val ytest: Some[C[_ >: X[A | B] <: X[A & B]]] = y + val xtest: C[? >: X[A | B] <: X[A & B]] & D = x + val ytest: Some[C[? >: X[A | B] <: X[A & B]]] = y } } diff --git a/tests/pos/arrays3.scala b/tests/pos/arrays3.scala index f96be0b427fb..db53955e4da9 100644 --- a/tests/pos/arrays3.scala +++ b/tests/pos/arrays3.scala @@ -2,10 +2,10 @@ trait Foo { type Repr <: String def f2(x: Repr) = x.length } -trait Fooz[Repr <: Array[_]] { +trait Fooz[Repr <: Array[?]] { def f0(x: Repr) = x.length } -trait Bar[Repr <: List[_]] extends Foo with Fooz[Array[Int]] { +trait Bar[Repr <: List[?]] extends Foo with Fooz[Array[Int]] { def f1(x: Repr) = x.length } diff --git a/tests/pos/capture-variance.scala b/tests/pos/capture-variance.scala index 9f856e31438e..6b506ed3f9db 100644 --- a/tests/pos/capture-variance.scala +++ b/tests/pos/capture-variance.scala @@ -6,8 +6,8 @@ class Contra1[-T] class Contra2[-T >: Lo <: Hi] object Test { - val a: List[Cov1[Any]] = ??? : List[Cov1[_]] - val b: List[Cov2[Hi]] = ??? : List[Cov2[_]] - val c: List[Contra1[Nothing]] = ??? : List[Contra1[_]] - val d: List[Contra2[Lo]] = ??? : List[Contra2[_]] + val a: List[Cov1[Any]] = ??? : List[Cov1[?]] + val b: List[Cov2[Hi]] = ??? : List[Cov2[?]] + val c: List[Contra1[Nothing]] = ??? : List[Contra1[?]] + val d: List[Contra2[Lo]] = ??? : List[Contra2[?]] } diff --git a/tests/pos/capture.scala b/tests/pos/capture.scala index 76a47bf497b2..03845f0de586 100644 --- a/tests/pos/capture.scala +++ b/tests/pos/capture.scala @@ -29,7 +29,7 @@ class Test { def toExpr(implicit ev: Liftable[T]): Expr[T] = ??? } - def runtimeClass: Class[_] = ??? + def runtimeClass: Class[?] = ??? runtimeClass.toExpr(ClassIsLiftable) // OK for skolemization-as-a-whole and skolemization-of-each-param diff --git a/tests/pos/conformsWild.scala b/tests/pos/conformsWild.scala index cfc10d92df47..34f7fd8ff05b 100644 --- a/tests/pos/conformsWild.scala +++ b/tests/pos/conformsWild.scala @@ -1,11 +1,11 @@ object Test { - val x: Function1[_, _] = (x: String) => 1 + val x: Function1[?, ?] = (x: String) => 1 - val y: Function1[_, _] = x => 1 - val y0: Function1[_, _] = x => x - val y1: Function1[_, Nothing] = x => x + val y: Function1[?, ?] = x => 1 + val y0: Function1[?, ?] = x => x + val y1: Function1[?, Nothing] = x => x - val z: (_, _) = (1, 2) + val z: (?, ?) = (1, 2) } diff --git a/tests/pos/enum-List-control.scala b/tests/pos/enum-List-control.scala index 0810f9d09bf8..752c15fff7bd 100644 --- a/tests/pos/enum-List-control.scala +++ b/tests/pos/enum-List-control.scala @@ -2,7 +2,7 @@ abstract sealed class List[T] extends reflect.Enum object List { final class Cons[T](x: T, xs: List[T]) extends List[T] { def ordinal = 0 - def canEqual(that: Any): Boolean = that.isInstanceOf[Cons[_]] + def canEqual(that: Any): Boolean = that.isInstanceOf[Cons[?]] def productArity: Int = 2 def productElement(n: Int): Any = n match case 0 => x diff --git a/tests/pos/enum-interop.scala b/tests/pos/enum-interop.scala index 0c9aca79bbe7..fc190d3f7d40 100644 --- a/tests/pos/enum-interop.scala +++ b/tests/pos/enum-interop.scala @@ -2,9 +2,9 @@ object Test { - val cls: java.lang.Class[_] = ??? + val cls: java.lang.Class[?] = ??? - def myAsInstanceOf[T <: Class[T]](cls: java.lang.Class[_]): Class[T] = cls.asInstanceOf[Class[T]] + def myAsInstanceOf[T <: Class[T]](cls: java.lang.Class[?]): Class[T] = cls.asInstanceOf[Class[T]] Enum.valueOf(myAsInstanceOf(cls), "") diff --git a/tests/pos/enum-widen.scala b/tests/pos/enum-widen.scala index 47f3a915d502..dcbb61b39e2f 100644 --- a/tests/pos/enum-widen.scala +++ b/tests/pos/enum-widen.scala @@ -15,7 +15,7 @@ object test: enum Nat: case Z - case S[N <: Z.type | S[_]](pred: N) + case S[N <: Z.type | S[?]](pred: N) import Nat.* val two = S(S(Z)) diff --git a/tests/pos/erasure-array.scala b/tests/pos/erasure-array.scala index 63240e9801f0..31c2af534fe7 100644 --- a/tests/pos/erasure-array.scala +++ b/tests/pos/erasure-array.scala @@ -2,7 +2,7 @@ package hello object world { - def mkArray(atype: Int): Array[_ <: AnyVal] = { + def mkArray(atype: Int): Array[? <: AnyVal] = { (if (atype == 1) new Array[Int](10) else new Array[Float](10)) } diff --git a/tests/pos/escapingRefs.scala b/tests/pos/escapingRefs.scala index 190e99d97378..da8ef73047ae 100644 --- a/tests/pos/escapingRefs.scala +++ b/tests/pos/escapingRefs.scala @@ -34,9 +34,9 @@ object Test { new Bar[Int] } */ - val e: Foo[_] = { + val e: Foo[?] = { class Bar[B11] extends Foo[B11] - new Bar[Int]: Bar[_ <: Int] + new Bar[Int]: Bar[? <: Int] } } } diff --git a/tests/pos/exbound.scala b/tests/pos/exbound.scala index be78abc269de..850cd49f820a 100644 --- a/tests/pos/exbound.scala +++ b/tests/pos/exbound.scala @@ -3,5 +3,5 @@ class A[T <: A[T]] { } object Test { - val x: A[_] = null + val x: A[?] = null } diff --git a/tests/pos/exhaust_2.scala b/tests/pos/exhaust_2.scala index 4f4e47c43b5e..62bd8f6665f3 100644 --- a/tests/pos/exhaust_2.scala +++ b/tests/pos/exhaust_2.scala @@ -5,7 +5,7 @@ object ExhaustivityWarnBugReportMinimal { // sealed abstract class FoundNode[T]/*presence of parameters is irrelevant*/ case class FoundFilter[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] case class FoundTypeCase[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] - val f: Some[_] = ??? + val f: Some[?] = ??? f match { case x: Some[t] => //no warning } @@ -14,23 +14,23 @@ object ExhaustivityWarnBugReportMinimal { //val v: (Some[AnyRef], FoundNode[_]) = (???, ???) //val v: (Some[String], FoundNode[_]) = (???, ???) - val v: (Some[_], FoundNode[_]) = (???, ???) + val v: (Some[?], FoundNode[?]) = (???, ???) //Warning here: v match { - case (x: Some[t], _: FoundNode[_]) => + case (x: Some[t], _: FoundNode[?]) => } v match { case (x: Some[t], _) => } v match { - case (x: Some[_], _) => + case (x: Some[?], _) => } case class Foo[T]() - val vp: (Foo[_], FoundNode[_]) = (???, ???) + val vp: (Foo[?], FoundNode[?]) = (???, ???) vp match { - case (x: Foo[_], _) => + case (x: Foo[?], _) => } //No warning here: @@ -42,13 +42,13 @@ object ExhaustivityWarnBugReportMinimal { case (x, _) => } - val v2: (Some[_], Int) = (???, ???) + val v2: (Some[?], Int) = (???, ???) v2 match { case (x: Some[t], _) => } - val v3: (Option[_], FoundNode[_]) = (???, ???) + val v3: (Option[?], FoundNode[?]) = (???, ???) v match { - case (x: Option[_], _) => + case (x: Option[?], _) => } } diff --git a/tests/pos/existential-java-case-class/Client.scala b/tests/pos/existential-java-case-class/Client.scala index 368899820f99..e09eb327fead 100644 --- a/tests/pos/existential-java-case-class/Client.scala +++ b/tests/pos/existential-java-case-class/Client.scala @@ -1,3 +1,3 @@ -case class CC(x: J[_]) +case class CC(x: J[?]) -case class CC1(x: Any => J[_]) +case class CC1(x: Any => J[?]) diff --git a/tests/pos/extractor-types.scala b/tests/pos/extractor-types.scala index 200279be6ffe..f6ce59103013 100644 --- a/tests/pos/extractor-types.scala +++ b/tests/pos/extractor-types.scala @@ -1,5 +1,5 @@ package p1 { - object Ex { def unapply(p: Any): Option[_ <: Int] = null } + object Ex { def unapply(p: Any): Option[? <: Int] = null } object Foo { val Ex(_) = null } } // a.scala:2: error: error during expansion of this match (this is a scalac bug). diff --git a/tests/pos/fbounds.scala b/tests/pos/fbounds.scala index dd56de37f11a..984fa8b2bd40 100644 --- a/tests/pos/fbounds.scala +++ b/tests/pos/fbounds.scala @@ -1 +1 @@ -class A [ T <: A[_] & Number] +class A [ T <: A[?] & Number] diff --git a/tests/pos/gadt-GadtStlc.scala b/tests/pos/gadt-GadtStlc.scala index d3a645486a33..2d071ad1957d 100644 --- a/tests/pos/gadt-GadtStlc.scala +++ b/tests/pos/gadt-GadtStlc.scala @@ -101,7 +101,7 @@ object GadtStlc { case class ISLAMBDAC[X, E]() extends ISLAMBDA[Abs[Var[X], E]] // evidence that E reduces - type REDUCES[E] = REDUDER[E, _] + type REDUCES[E] = REDUDER[E, ?] def followsIsLambda[G, V, TY1, TY2]( isval: ISVAL[V], diff --git a/tests/pos/hkRefAlias.scala b/tests/pos/hkRefAlias.scala index 58ec787def1c..327b9309b45a 100644 --- a/tests/pos/hkRefAlias.scala +++ b/tests/pos/hkRefAlias.scala @@ -5,6 +5,6 @@ class Y extends X object Test { type G[X] = Bar { type R = X } - implicitly[G[_] =:= (Bar { type R })] - implicitly[G[_ >: Y <: X] =:= (Bar { type R >: Y <: X })] + implicitly[G[?] =:= (Bar { type R })] + implicitly[G[? >: Y <: X] =:= (Bar { type R >: Y <: X })] } diff --git a/tests/pos/i0290-type-bind-2.scala b/tests/pos/i0290-type-bind-2.scala index bfad266eaedb..e6bb1434913f 100644 --- a/tests/pos/i0290-type-bind-2.scala +++ b/tests/pos/i0290-type-bind-2.scala @@ -7,14 +7,14 @@ object foo{ object bar { - class C[T <: Seq[_]] + class C[T <: Seq[?]] val x: AnyRef = new C x match { case x: C[u] => def x: u = x - val s: Seq[_] = x + val s: Seq[?] = x } } @@ -27,14 +27,14 @@ object foo2{{ object bar2 {{ - class C[T <: Seq[_]] + class C[T <: Seq[?]] val x: AnyRef = new C x match { case x: C[u] => def x: u = x - val s: Seq[_] = x + val s: Seq[?] = x } }} @@ -47,13 +47,13 @@ object foo3{ val x0 = { object bar3 { def f0 = { - class C[T <: Seq[_]] + class C[T <: Seq[?]] val x: AnyRef = new C x match { case x: C[u] => def x: u = x - val s: Seq[_] = x + val s: Seq[?] = x } }} diff --git a/tests/pos/i0290-type-bind.scala b/tests/pos/i0290-type-bind.scala index 83fdbbcc54d4..a26540242a38 100644 --- a/tests/pos/i0290-type-bind.scala +++ b/tests/pos/i0290-type-bind.scala @@ -7,13 +7,13 @@ object foo{ object bar { - class C[T <: Seq[_]] + class C[T <: Seq[?]] val x: AnyRef = new C x match { case x: C[u] => def x: u = x - val s: Seq[_] = x + val s: Seq[?] = x } } diff --git a/tests/pos/i0306.scala b/tests/pos/i0306.scala index 5a242fa83d91..9e393b09cb6a 100644 --- a/tests/pos/i0306.scala +++ b/tests/pos/i0306.scala @@ -1,6 +1,6 @@ object bar { - class C[T <: Seq[_]] + class C[T <: Seq[?]] val x: AnyRef = new C diff --git a/tests/pos/i10964a.scala b/tests/pos/i10964a.scala index 98ea22f4f098..2057643bd8ed 100644 --- a/tests/pos/i10964a.scala +++ b/tests/pos/i10964a.scala @@ -45,7 +45,7 @@ object Ref { object Make extends MakeInstances trait MakeInstances extends MakeLowPriorityInstances { - implicit def concurrentInstance[F[_]](implicit F: Concurrent[F, _]): Make[F] = ??? + implicit def concurrentInstance[F[_]](implicit F: Concurrent[F, ?]): Make[F] = ??? } trait MakeLowPriorityInstances { diff --git a/tests/pos/i11057.scala b/tests/pos/i11057.scala index 7ccd5ccac56d..1368cf6639c5 100644 --- a/tests/pos/i11057.scala +++ b/tests/pos/i11057.scala @@ -8,13 +8,13 @@ object data { type DSeq[X] = scala.collection.immutable.AbstractSeq[X] case class ColumnName[T](n:String, t: OfType[T]) - case class Column[T,F[_]<:DSeq[_]](n:F[T], of: ColumnName[T]) + case class Column[T,F[_]<:DSeq[?]](n:F[T], of: ColumnName[T]) } def min4[T,F[_]<:data.DSeq[T]](col: data.Column[T,F])(using Ordering[T]): T = { col match { - case c:data.Column[Int,_] => c.n.min[T](Ordering[T]) - case _:data.Column[Double,_] => ??? - case _:data.Column[Float,_] => ??? + case c:data.Column[Int,?] => c.n.min[T](Ordering[T]) + case _:data.Column[Double,?] => ??? + case _:data.Column[Float,?] => ??? } } diff --git a/tests/pos/i11064.scala b/tests/pos/i11064.scala index 286b3d8dcc07..bcab19373ea7 100644 --- a/tests/pos/i11064.scala +++ b/tests/pos/i11064.scala @@ -1,9 +1,9 @@ trait TypedArray[T, Repr] -trait Ops[T <: TypedArray[_, T]] { +trait Ops[T <: TypedArray[?, T]] { def typedArray(): T } object Test { - def test(ops: Ops[_ <: TypedArray[_, _]]) = ops.typedArray() + def test(ops: Ops[? <: TypedArray[?, ?]]) = ops.typedArray() } \ No newline at end of file diff --git a/tests/pos/i11174minimisation.scala b/tests/pos/i11174minimisation.scala index c40c34552bb8..2bf5391cfe6e 100644 --- a/tests/pos/i11174minimisation.scala +++ b/tests/pos/i11174minimisation.scala @@ -11,7 +11,7 @@ object EnumerateNames { case m: Mirror.ProductOf[T] => ??? case m: Mirror.SumOf[T] => inline erasedValue[m.MirroredElemTypes] match - case _: (tpe *: _) => summonInline[EnumerateNames[tpe]] + case _: (tpe *: ?) => summonInline[EnumerateNames[tpe]] case _: EmptyTuple => ??? } diff --git a/tests/pos/i11236.scala b/tests/pos/i11236.scala index e2b9892d4f43..5dcc3e659120 100644 --- a/tests/pos/i11236.scala +++ b/tests/pos/i11236.scala @@ -11,7 +11,7 @@ trait TupleK object TupleK { type Tail[X <: NonEmptyTupleK] <: TupleK = X match { - case _ #: xs => xs + case ? #: xs => xs } } diff --git a/tests/pos/i11995.scala b/tests/pos/i11995.scala index d5a089c1bb35..46d4135da45e 100644 --- a/tests/pos/i11995.scala +++ b/tests/pos/i11995.scala @@ -12,7 +12,7 @@ trait Clock type ConsoleWithClock = Has[Console] with Has[Clock] -class Spec[R <: Has[_]] +class Spec[R <: Has[?]] object MySpec1 extends Spec[Has[Console] with Has[Clock]] // does not compile object MySpec2 extends Spec[ConsoleWithClock] // okay diff --git a/tests/pos/i1202d.scala b/tests/pos/i1202d.scala index d03adf1971fb..12ae2415da9a 100644 --- a/tests/pos/i1202d.scala +++ b/tests/pos/i1202d.scala @@ -1,4 +1,4 @@ class Fail5 { - val someClass: Class[_] = ??? + val someClass: Class[?] = ??? val resultMethod = someClass.getMethod("result") } diff --git a/tests/pos/i12211.scala b/tests/pos/i12211.scala index 6c117e0bf474..82fc176fc599 100644 --- a/tests/pos/i12211.scala +++ b/tests/pos/i12211.scala @@ -21,7 +21,7 @@ def test3: (a: AA) => (b: BB[a.type]) => BB[?] = (a: AA) => (b: BB[a.type]) => b trait RelaxedSelectable extends Selectable.WithoutPreciseParameterTypes: - def applyDynamic(name: String, paramTypes: Class[_]*)(args: Any*): Any = ??? + def applyDynamic(name: String, paramTypes: Class[?]*)(args: Any*): Any = ??? class Sink[A] extends RelaxedSelectable { def put(x: A): Unit = {} diff --git a/tests/pos/i12739.scala b/tests/pos/i12739.scala index baf7a7ae2698..9b5789a1dff9 100644 --- a/tests/pos/i12739.scala +++ b/tests/pos/i12739.scala @@ -1,10 +1,10 @@ object X { class CA[A] - type C = CA[_] + type C = CA[?] val c: C = ??? def f[A](r: CA[A]) = () - def g(): CA[_] = CA() + def g(): CA[?] = CA() def h(): C = ??? // works @@ -20,7 +20,7 @@ object X { // works, error in Scala 2 f(c.asInstanceOf[c.type]) - f(c.asInstanceOf[CA[_]]) + f(c.asInstanceOf[CA[?]]) f(g()) f(h()) } diff --git a/tests/pos/i12953.scala b/tests/pos/i12953.scala index a50bbda70187..dd7b165c9da4 100644 --- a/tests/pos/i12953.scala +++ b/tests/pos/i12953.scala @@ -1,4 +1,4 @@ -class Schema(impl: Class[_]) extends scala.annotation.StaticAnnotation +class Schema(impl: Class[?]) extends scala.annotation.StaticAnnotation class Ann[A] extends scala.annotation.StaticAnnotation diff --git a/tests/pos/i13190/B_2.scala b/tests/pos/i13190/B_2.scala index 2752778afa04..c81af64e1472 100644 --- a/tests/pos/i13190/B_2.scala +++ b/tests/pos/i13190/B_2.scala @@ -3,7 +3,7 @@ import Opaque.* object Test { type FindField[R <: scala.Tuple, K] = R match { case FieldType[K, f] *: t => f - case _ *: t => FindField[t, K] + case ? *: t => FindField[t, K] } val f: FieldType["A", Int] = ??? diff --git a/tests/pos/i1365.scala b/tests/pos/i1365.scala index e7d47da4b759..73512d1ef9d9 100644 --- a/tests/pos/i1365.scala +++ b/tests/pos/i1365.scala @@ -5,7 +5,7 @@ class Script[S] extends ArrayBuffer[Message[S]] with Message[S] class Test[A] { def f(cmd: Message[A]): Unit = cmd match { - case s: Script[_] => s.iterator.foreach(x => f(x)) + case s: Script[?] => s.iterator.foreach(x => f(x)) } def g(cmd: Message[A]): Unit = cmd match { case s: Script[z] => s.iterator.foreach(x => g(x)) diff --git a/tests/pos/i13998.scala b/tests/pos/i13998.scala index 474c6dca9e30..acbcc888c5d4 100644 --- a/tests/pos/i13998.scala +++ b/tests/pos/i13998.scala @@ -4,7 +4,7 @@ object Box: def unapply[U](b: Box[U]): Box[U] = b class Test: - def value: Box[_ <: String] = Box("text") + def value: Box[? <: String] = Box("text") def test: String = value match case Box(text) => text: String diff --git a/tests/pos/i14151.scala b/tests/pos/i14151.scala index fbb124794595..be08a57a20cf 100644 --- a/tests/pos/i14151.scala +++ b/tests/pos/i14151.scala @@ -1,2 +1,2 @@ class BoundedPair[A, B <: A]: - type Second[A, T <: BoundedPair[A, _ <: A]] <: A = T match { case BoundedPair[A, b] => b } + type Second[A, T <: BoundedPair[A, ? <: A]] <: A = T match { case BoundedPair[A, b] => b } diff --git a/tests/pos/i14151b.scala b/tests/pos/i14151b.scala index f3f0e429ff79..dc17021733c8 100644 --- a/tests/pos/i14151b.scala +++ b/tests/pos/i14151b.scala @@ -1,2 +1,2 @@ class Single[B](val value: B): - type Retrieve[A, T <: Single[_ <: A]] <: A = T match { case Single[b] => b } + type Retrieve[A, T <: Single[? <: A]] <: A = T match { case Single[b] => b } diff --git a/tests/pos/i14152.scala b/tests/pos/i14152.scala index 2377d5ffeae3..bd15dc71f2be 100644 --- a/tests/pos/i14152.scala +++ b/tests/pos/i14152.scala @@ -2,19 +2,19 @@ val a1 = { object O1 extends AnyRef Array(O1) } -val a2: Array[_ <: AnyRef] = aa1 +val a2: Array[? <: AnyRef] = aa1 val aa1 = { object O1 extends AnyRef Array(Array(O1)) } -val aa2: Array[_ <: Array[_ <: AnyRef]] = aa1 +val aa2: Array[? <: Array[? <: AnyRef]] = aa1 val aaa1 = { object O1 extends AnyRef Array(Array(Array(O1))) } -val aaa2: Array[_ <: Array[_ <: Array[_ <: AnyRef]]] = aaa1 +val aaa2: Array[? <: Array[? <: Array[? <: AnyRef]]] = aaa1 // Let's make sure avoidance still does the right thing given abstract type constructors diff --git a/tests/pos/i14271.scala b/tests/pos/i14271.scala index 8f46940afd09..adbb39c2e6a3 100644 --- a/tests/pos/i14271.scala +++ b/tests/pos/i14271.scala @@ -7,7 +7,7 @@ class Container[V] { } def bug() = { - val m = new Container[MyClass[_]] + val m = new Container[MyClass[?]] if (true) { m.doSth() } diff --git a/tests/pos/i14349.min.scala b/tests/pos/i14349.min.scala index 8922d73056d6..577259f689be 100644 --- a/tests/pos/i14349.min.scala +++ b/tests/pos/i14349.min.scala @@ -10,4 +10,4 @@ class Module: def expose = new Inv[M] def test = this match { case m => m.expose } // was: leak: `(m : Module)` in `m.expose: Inv[? <: Module { X = m.X }]` - def res: Inv[_ <: Module] = this match { case m => m.expose } + def res: Inv[? <: Module] = this match { case m => m.expose } diff --git a/tests/pos/i14349.scala b/tests/pos/i14349.scala index 05e4e1e3603f..1aa35ee1aaa5 100644 --- a/tests/pos/i14349.scala +++ b/tests/pos/i14349.scala @@ -15,5 +15,5 @@ trait Expose[ M <: Module { type X = X0; type Y = Y0 } ] -def test(ms: Seq[Option[Module]]): Seq[Expose[_, _, _]] = +def test(ms: Seq[Option[Module]]): Seq[Expose[?, ?, ?]] = ms.collect { case Some(module) => module.expose } diff --git a/tests/pos/i14832.scala b/tests/pos/i14832.scala index 9f486062e111..d77fb4e1387d 100644 --- a/tests/pos/i14832.scala +++ b/tests/pos/i14832.scala @@ -4,4 +4,4 @@ class Test: def value: Box["text"] = Box("text") def test: String = value match - case b: Box[_ <: String] => b.value + case b: Box[? <: String] => b.value diff --git a/tests/pos/i14896.scala b/tests/pos/i14896.scala index 2ef595fbcaa4..fc12628d7be3 100644 --- a/tests/pos/i14896.scala +++ b/tests/pos/i14896.scala @@ -1,2 +1,2 @@ -object Ex { def unapply(p: Any): Option[_ <: Int] = null } +object Ex { def unapply(p: Any): Option[? <: Int] = null } object Foo { val Ex(_) = null: @unchecked } \ No newline at end of file diff --git a/tests/pos/i14903b.scala b/tests/pos/i14903b.scala index cd61a12e858c..ab54e6f00265 100644 --- a/tests/pos/i14903b.scala +++ b/tests/pos/i14903b.scala @@ -31,7 +31,7 @@ sealed trait TailSwitch[L <: HList, T <: HList, R <: HList]: object TailSwitch: type TS[L <: HList, T <: HList, R <: HList] <: HList = StripSuffix[T, L] match - case Some[_] => R + case Some[?] => R case _ => StripSuffix[L, T] match case Some[x] => Concat[x, R] diff --git a/tests/pos/i15154.scala b/tests/pos/i15154.scala index 42f805e022a9..8bc6ba4017f9 100644 --- a/tests/pos/i15154.scala +++ b/tests/pos/i15154.scala @@ -1,21 +1,21 @@ trait RType trait TypeEntry{ - def typeAdapter: TypeAdapter[_] = ??? + def typeAdapter: TypeAdapter[?] = ??? } trait TypeAdapter[E] case class OptionTypeAdapter[E](nullIsNone: Boolean, valueTypeAdapter: TypeAdapter[E]) extends TypeAdapter[E] case class JavaOptionalTypeAdapter[E](nullIsNone: Boolean, valueTypeAdapter: TypeAdapter[E]) extends TypeAdapter[E] -def typeAdapterOf(concreteType: RType): TypeAdapter[_] = ??? +def typeAdapterOf(concreteType: RType): TypeAdapter[?] = ??? @main def test() = { // https://github.com/gzoller/scalajack/blob/4a29366e28fbd594d7c21b4eb969ca14626ac0d1/core/src/main/scala/co.blocke.scalajack/typeadapter/TupleTypeAdapter.scala#L21-L30 val seq = List.empty[RType] seq map { f => typeAdapterOf(f) match { - case ota: OptionTypeAdapter[_] => ota.copy(nullIsNone = true) - case jota: JavaOptionalTypeAdapter[_] => jota.copy(nullIsNone = true) + case ota: OptionTypeAdapter[?] => ota.copy(nullIsNone = true) + case jota: JavaOptionalTypeAdapter[?] => jota.copy(nullIsNone = true) case other => other } } diff --git a/tests/pos/i15595.scala b/tests/pos/i15595.scala index b5d6cf402ed3..ec95784f64c6 100644 --- a/tests/pos/i15595.scala +++ b/tests/pos/i15595.scala @@ -1,7 +1,7 @@ trait MatchResult[+T] @main def Test() = { - def convert[T <: Seq[_], U <: MatchResult[_]](fn: T => U)(implicit x: Seq[_] = Seq.empty): U = ??? + def convert[T <: Seq[?], U <: MatchResult[?]](fn: T => U)(implicit x: Seq[?] = Seq.empty): U = ??? def resultOf[T](v: T): MatchResult[T] = ??? convert { _ => diff --git a/tests/pos/i15677.scala b/tests/pos/i15677.scala index 2ad2b5283057..8b3b81021e6b 100644 --- a/tests/pos/i15677.scala +++ b/tests/pos/i15677.scala @@ -6,5 +6,5 @@ class Bar[C, N[_]] extends Foo[C, N]: def inv: Inv[C] = null def test(foo: Foo[Int, Option]): Inv[Int] = foo match - case bar: Bar[_, _] => bar.inv + case bar: Bar[?, ?] => bar.inv case _ => null diff --git a/tests/pos/i15717.scala b/tests/pos/i15717.scala index 337a1f08ed10..0e4c3f072163 100644 --- a/tests/pos/i15717.scala +++ b/tests/pos/i15717.scala @@ -1,10 +1,10 @@ //> using options -Werror class Test: - def pmat(xs: java.util.Vector[_]): String = xs.get(0) match + def pmat(xs: java.util.Vector[?]): String = xs.get(0) match case d: Double => d.toString() // was: error: unreachable case, which is spurious case _ => "shrug" - def pmatR(xs: java.util.Vector[_]): String = + def pmatR(xs: java.util.Vector[?]): String = val scr = xs.get(0) 1.0 match case `scr` => scr.toString() // for the reverse provablyDisjoint case diff --git a/tests/pos/i15802.scala b/tests/pos/i15802.scala index ac67f420508c..fa4847e9448a 100644 --- a/tests/pos/i15802.scala +++ b/tests/pos/i15802.scala @@ -9,5 +9,5 @@ trait Endpoint[INPUT, ERROR_OUTPUT, OUTPUT]{ } @main def Test() = - val x: Endpoint[_, Unit, Unit] = ??? + val x: Endpoint[?, Unit, Unit] = ??? x.zServerLogic[Any](_ => ZIO.fail(new RuntimeException("boom"))) \ No newline at end of file diff --git a/tests/pos/i15893.scala b/tests/pos/i15893.scala index af6e7ae38ad2..c9ef86fd28c6 100644 --- a/tests/pos/i15893.scala +++ b/tests/pos/i15893.scala @@ -25,17 +25,17 @@ transparent inline def transparentInlineMod2(inline n: NatT): NatT = inline n m def dependentlyTypedMod2[N <: NatT](n: N): Mod2[N] = n match case Zero(): Zero => Zero() // warning case Succ(Zero()): Succ[Zero] => Succ(Zero()) // warning - case Succ(Succ(predPredN)): Succ[Succ[_]] => dependentlyTypedMod2(predPredN) // warning + case Succ(Succ(predPredN)): Succ[Succ[?]] => dependentlyTypedMod2(predPredN) // warning inline def inlineDependentlyTypedMod2[N <: NatT](inline n: N): Mod2[N] = inline n match case Zero(): Zero => Zero() // warning case Succ(Zero()): Succ[Zero] => Succ(Zero()) // warning - case Succ(Succ(predPredN)): Succ[Succ[_]] => inlineDependentlyTypedMod2(predPredN) // warning + case Succ(Succ(predPredN)): Succ[Succ[?]] => inlineDependentlyTypedMod2(predPredN) // warning transparent inline def transparentInlineDependentlyTypedMod2[N <: NatT](inline n: N): Mod2[N] = inline n match case Zero(): Zero => Zero() // warning case Succ(Zero()): Succ[Zero] => Succ(Zero()) // warning - case Succ(Succ(predPredN)): Succ[Succ[_]] => transparentInlineDependentlyTypedMod2(predPredN) // warning + case Succ(Succ(predPredN)): Succ[Succ[?]] => transparentInlineDependentlyTypedMod2(predPredN) // warning def foo(n: NatT): NatT = mod2(n) match case Succ(Zero()) => Zero() diff --git a/tests/pos/i15940.scala b/tests/pos/i15940.scala index e460367a6c03..6877a8bfff08 100644 --- a/tests/pos/i15940.scala +++ b/tests/pos/i15940.scala @@ -13,7 +13,7 @@ import Ops._ val test: Either[BuildException, Seq[ActionableDiagnostic]] = // Can be replaced with Seq[Either[BuildException, Seq[ _ <: ActionableDiagnostic]]] , but current version matches better type of missing implicit - Seq.empty[ActionableHandler[_]].map(_.exec) + Seq.empty[ActionableHandler[?]].map(_.exec) .sequence .left.map(_.head) .map(_.flatten) // error \ No newline at end of file diff --git a/tests/pos/i16105.scala b/tests/pos/i16105.scala index 477e47e98aa7..29abd8e7ad12 100644 --- a/tests/pos/i16105.scala +++ b/tests/pos/i16105.scala @@ -5,8 +5,8 @@ trait QuerySQLSyntaxProvider[S <: SQLSyntaxSupport[A], A]{ def resultName: ResultNameSQLSyntaxProvider[S, A] = ??? } -def include(syntaxProviders: QuerySQLSyntaxProvider[_, _]*) = { +def include(syntaxProviders: QuerySQLSyntaxProvider[?, ?]*) = { syntax(syntaxProviders.map(_.resultName): _*) } -def syntax(resultNames: ResultNameSQLSyntaxProvider[_, _]*) = ??? \ No newline at end of file +def syntax(resultNames: ResultNameSQLSyntaxProvider[?, ?]*) = ??? \ No newline at end of file diff --git a/tests/pos/i16407.scala b/tests/pos/i16407.scala index 8529f81a29af..6c5b43d4d6c7 100644 --- a/tests/pos/i16407.scala +++ b/tests/pos/i16407.scala @@ -1,5 +1,5 @@ trait X { //missing requirement: self type Z[?] & X of trait X does not conform to self type Z[X.this.A] of required trait Z - self: Z[_] => + self: Z[?] => } trait Z[A] extends X { diff --git a/tests/pos/i16443/TypeHints_1.scala b/tests/pos/i16443/TypeHints_1.scala index 40047bf46243..9aa98cac807e 100644 --- a/tests/pos/i16443/TypeHints_1.scala +++ b/tests/pos/i16443/TypeHints_1.scala @@ -1,12 +1,12 @@ // This should be run with Scala 2.13 trait TypeHints { - val hints: List[Class[_]] + val hints: List[Class[?]] def components: List[TypeHints] = List(this) def + (hints: TypeHints): TypeHints = CompositeTypeHints(components ::: hints.components) private case class CompositeTypeHints(override val components: List[TypeHints]) extends TypeHints { - override val hints: List[Class[_]] = components.flatMap(_.hints) + override val hints: List[Class[?]] = components.flatMap(_.hints) } } diff --git a/tests/pos/i16596.orig.scala b/tests/pos/i16596.orig.scala index 0a562c6936c0..2f1bba81d6e5 100644 --- a/tests/pos/i16596.orig.scala +++ b/tests/pos/i16596.orig.scala @@ -1,7 +1,7 @@ import scala.compiletime.ops.int type Count0[N,T] <: Tuple = (N,T) match - case (0,_) => EmptyTuple + case (0,?) => EmptyTuple case (N,String) => String *: Count0[int.-[N, 1], String] case (N,Int) => Int *: Count0[int.-[N, 1], Int] case (N,Float) => Float *: Count0[int.-[N, 1], Float] diff --git a/tests/pos/i16792.scala b/tests/pos/i16792.scala index 5a44d8c09458..2a52dc53d213 100644 --- a/tests/pos/i16792.scala +++ b/tests/pos/i16792.scala @@ -1,2 +1,2 @@ val x = (1, 1) match - case _: (_ *: _) => () + case _: (? *: ?) => () diff --git a/tests/pos/i17149.scala b/tests/pos/i17149.scala index 7a659334badb..4c1b69d92378 100644 --- a/tests/pos/i17149.scala +++ b/tests/pos/i17149.scala @@ -1,4 +1,4 @@ -type Ext[S <: Seq[_]] = S match { +type Ext[S <: Seq[?]] = S match { case Seq[t] => t } diff --git a/tests/pos/i18211.scala b/tests/pos/i18211.scala index c5ec30ba5d61..e5d8843506be 100644 --- a/tests/pos/i18211.scala +++ b/tests/pos/i18211.scala @@ -7,7 +7,7 @@ type AnyInt[A <: Int] <: Int = A match { type IndexOf[A, T <: Tuple] <: Int = T match { case EmptyTuple => -1 case A *: t => 0 - case _ *: t => + case ? *: t => IndexOf[A, t] match { case -1 => -1 case AnyInt[a] => S[a] diff --git a/tests/pos/i18226a.scala b/tests/pos/i18226a.scala index e8db52adbc72..5ebd8ec82cc1 100644 --- a/tests/pos/i18226a.scala +++ b/tests/pos/i18226a.scala @@ -7,7 +7,7 @@ class Spec[-R] { def foo[R1 <: R](aspect: TestAspect[R1, R1]): Unit = {} } -class SuiteBuilder[R <: Has[_]] { +class SuiteBuilder[R <: Has[?]] { def toSpec( spec: Spec[R & Has[Foo]], aspect: TestAspect[ diff --git a/tests/pos/i2112.scala b/tests/pos/i2112.scala index cccd745cfe18..2986fe19eddc 100644 --- a/tests/pos/i2112.scala +++ b/tests/pos/i2112.scala @@ -2,6 +2,6 @@ import scala.jdk.CollectionConverters.* object Test { def test(x: Any): Unit = { - x.asInstanceOf[java.util.List[_]].asScala.toList + x.asInstanceOf[java.util.List[?]].asScala.toList } } diff --git a/tests/pos/i2232.scala b/tests/pos/i2232.scala index 21b4109520a6..5e43daf5bf9a 100644 --- a/tests/pos/i2232.scala +++ b/tests/pos/i2232.scala @@ -16,7 +16,7 @@ object Cats { } object Category { - type ByF[F[_, _]] = Category[_] { type -> [X, Y] = F[X, Y] } + type ByF[F[_, _]] = Category[?] { type -> [X, Y] = F[X, Y] } } type Scal[f[_[_], _[_, _]]] = f[Trivial, Function1] diff --git a/tests/pos/i2250.scala b/tests/pos/i2250.scala index a841a7085563..6173040a2034 100644 --- a/tests/pos/i2250.scala +++ b/tests/pos/i2250.scala @@ -1,5 +1,5 @@ class T { def foo(any: AnyRef): Unit = { - any.asInstanceOf[Array[_]].iterator + any.asInstanceOf[Array[?]].iterator } } \ No newline at end of file diff --git a/tests/pos/i2397.scala b/tests/pos/i2397.scala index 9e64f4370a01..e445954ef879 100644 --- a/tests/pos/i2397.scala +++ b/tests/pos/i2397.scala @@ -3,7 +3,7 @@ class Foo[A] object Test { def foo[T](x: Foo[T]) = x - foo((new Foo[Int]: Foo[_])) + foo((new Foo[Int]: Foo[?])) } import java.nio.file.* diff --git a/tests/pos/i2437b.scala b/tests/pos/i2437b.scala index 6dbc79475583..133625917e9f 100644 --- a/tests/pos/i2437b.scala +++ b/tests/pos/i2437b.scala @@ -1,6 +1,6 @@ class Foo[T] object Test { def foo[T](arg: Foo[T]) = arg match { - case bla: Foo[_] => + case bla: Foo[?] => } } diff --git a/tests/pos/i2554.scala b/tests/pos/i2554.scala index 488adba5906a..bcb48cdbd975 100644 --- a/tests/pos/i2554.scala +++ b/tests/pos/i2554.scala @@ -6,13 +6,13 @@ object foo { object Shape extends TupleShapeImplicits trait TupleShapeImplicits { implicit final def tuple2Shape[Level <: ShapeLevel, M1,M2, U1,U2, P1,P2]( - implicit u1: Shape[_ <: Level, M1, U1, P1], u2: Shape[_ <: Level, M2, U2, P2]) + implicit u1: Shape[? <: Level, M1, U1, P1], u2: Shape[? <: Level, M2, U2, P2]) : Shape[Level, (M1,M2), (U1,U2), (P1,P2)] = ??? } } object Test { import foo.* - implicit val shape: Shape[_ <: FlatShapeLevel, Int, Int, _] = null + implicit val shape: Shape[? <: FlatShapeLevel, Int, Int, ?] = null def hint = Shape.tuple2Shape(shape, shape) - val hint2: foo.Shape[foo.FlatShapeLevel, (Int, Int), (Int, Int), _] = hint + val hint2: foo.Shape[foo.FlatShapeLevel, (Int, Int), (Int, Int), ?] = hint } diff --git a/tests/pos/i2732.scala b/tests/pos/i2732.scala index a37634485409..8088f20e8463 100644 --- a/tests/pos/i2732.scala +++ b/tests/pos/i2732.scala @@ -1,5 +1,5 @@ object Test { - val f: java.util.function.Function[_ >: String, _ <: Int] = str => 1 + val f: java.util.function.Function[? >: String, ? <: Int] = str => 1 val i: Int = f("") } diff --git a/tests/pos/i2858.scala b/tests/pos/i2858.scala index d0474d9df81b..d3a8876570d5 100644 --- a/tests/pos/i2858.scala +++ b/tests/pos/i2858.scala @@ -2,7 +2,7 @@ class Cont[A0](x0: A0) { type A = A0; val x: A = x0 } object Test { def test: Unit = { - val c: Cont[_] & { type A = Int } = new Cont(1) + val c: Cont[?] & { type A = Int } = new Cont(1) c.x } } diff --git a/tests/pos/i3273/Test_2.scala b/tests/pos/i3273/Test_2.scala index adc5e362493c..958ac8dacb55 100644 --- a/tests/pos/i3273/Test_2.scala +++ b/tests/pos/i3273/Test_2.scala @@ -1,3 +1,3 @@ class Test extends Foo_1 { - override def foo(list: java.util.List[_]): Unit = ??? + override def foo(list: java.util.List[?]): Unit = ??? } diff --git a/tests/pos/i3598.scala b/tests/pos/i3598.scala index 99a641e3ad76..b955ddceac6b 100644 --- a/tests/pos/i3598.scala +++ b/tests/pos/i3598.scala @@ -1,5 +1,5 @@ class Foo[A] { - def baz(foo: Foo[_]): Unit = bar(foo) - def bam(foo: => Foo[_]) = bar(foo) + def baz(foo: Foo[?]): Unit = bar(foo) + def bam(foo: => Foo[?]) = bar(foo) def bar[A](foo: Foo[A]): A = ??? } diff --git a/tests/pos/i3666-gadt.scala b/tests/pos/i3666-gadt.scala index 382019660e3d..2525fbf9b096 100644 --- a/tests/pos/i3666-gadt.scala +++ b/tests/pos/i3666-gadt.scala @@ -30,7 +30,7 @@ object i3666 { def eval[T](e: Exp[T])(env: Env): T = e match { case Num(n) => n case Plus(e1, e2) => eval(e1)(env) + eval(e2)(env) - case v: Var[_] => env(v) + case v: Var[?] => env(v) case Lambda(x: Var[s], e) => ((y: s) => eval(e)(env + (x -> y))) case App(f, e) => eval(f)(env)(eval(e)(env)) } diff --git a/tests/pos/i3965.scala b/tests/pos/i3965.scala index e5aec615e71d..61b8c12cc305 100644 --- a/tests/pos/i3965.scala +++ b/tests/pos/i3965.scala @@ -10,7 +10,7 @@ class TreeSet[A] with SortedSetOps[A, TreeSet, TreeSet[A]] class Test { - def optionSequence1[CCos[X] <: IterableOps[X, CCos, _], A](xs: CCos[Option[A]]): Option[CCos[A]] = ??? + def optionSequence1[CCos[X] <: IterableOps[X, CCos, ?], A](xs: CCos[Option[A]]): Option[CCos[A]] = ??? def optionSequence1[CC[X] <: SortedSet[X] with SortedSetOps[X, CC, CC[X]], A : Ordering](xs: CC[Option[A]]): Option[CC[A]] = ??? def test(xs2: TreeSet[Option[String]]) = { diff --git a/tests/pos/i3976.scala b/tests/pos/i3976.scala index 7520830d6441..0143aa535afe 100644 --- a/tests/pos/i3976.scala +++ b/tests/pos/i3976.scala @@ -6,5 +6,5 @@ object Test { import Hoge.* A == A - A == (B: Hoge[_]) + A == (B: Hoge[?]) } diff --git a/tests/pos/i4167/Test_2.scala b/tests/pos/i4167/Test_2.scala index a0dcf504cf6b..c32136cc1815 100644 --- a/tests/pos/i4167/Test_2.scala +++ b/tests/pos/i4167/Test_2.scala @@ -2,5 +2,5 @@ package collection object Test { type AnyConstr[X] = Any - val test: SeqOps[Char, AnyConstr, _] = null.asInstanceOf[StringOps] + val test: SeqOps[Char, AnyConstr, ?] = null.asInstanceOf[StringOps] } diff --git a/tests/pos/i4188/collections_1.scala b/tests/pos/i4188/collections_1.scala index f5e8d8e3b383..d3d3db9e2e10 100644 --- a/tests/pos/i4188/collections_1.scala +++ b/tests/pos/i4188/collections_1.scala @@ -12,7 +12,7 @@ trait IterableOps[+A, +CC[_], +C] trait Map[K, +V] extends MapOps[K, V, Map, Map[K, V]] -trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C] +trait MapOps[K, +V, +CC[_, _] <: IterableOps[?, AnyConstr, ?], +C] extends IterableOps[(K, V), Iterable, C] { def view: MapView[K, V] = ??? } @@ -39,5 +39,5 @@ trait HasMapOps[C] { object decorators { def MapDecorator[C](coll: C)(implicit map: HasMapOps[C]): MapDecorator[C, map.type] = ??? - implicit def mapHasMapOps[CC[X, +Y] <: MapOps[X, Y, ({ type l[X, +Y] = IterableOps[_, AnyConstr, _] })#l, _], K0, V0]: HasMapOps[CC[K0, V0]] { type K = K0; type V = V0 } = ??? + implicit def mapHasMapOps[CC[X, +Y] <: MapOps[X, Y, ({ type l[X, +Y] = IterableOps[?, AnyConstr, ?] })#l, ?], K0, V0]: HasMapOps[CC[K0, V0]] { type K = K0; type V = V0 } = ??? } \ No newline at end of file diff --git a/tests/pos/i4198.scala b/tests/pos/i4198.scala index 667bd983fc9e..525b318bea7e 100644 --- a/tests/pos/i4198.scala +++ b/tests/pos/i4198.scala @@ -1,9 +1,9 @@ class Foo { def foo(x: Any): Unit = { x match { - case y: Bar[_] => + case y: Bar[?] => y.value match { - case value: Bar[_] => // here x is an instance of Bar[Bar[_]] + case value: Bar[?] => // here x is an instance of Bar[Bar[_]] case _ => } } diff --git a/tests/pos/i4375.scala b/tests/pos/i4375.scala index 233ab854a842..387b8ca82217 100644 --- a/tests/pos/i4375.scala +++ b/tests/pos/i4375.scala @@ -1,13 +1,13 @@ object Test { type Id[A] >: A def test: Unit = { - val a: Array[_ >: Id[Int]] = Array(1, 2) + val a: Array[? >: Id[Int]] = Array(1, 2) val b = a(0) } class VC(i: String) extends AnyVal def test2: Unit = { - val c: Array[_ >: Id[VC]] = Array(new VC("")) + val c: Array[? >: Id[VC]] = Array(new VC("")) val d = c(0) } } diff --git a/tests/pos/i536.scala b/tests/pos/i536.scala index e96ff48d12f7..5abc23fa326a 100644 --- a/tests/pos/i536.scala +++ b/tests/pos/i536.scala @@ -2,8 +2,8 @@ trait Comp[T] trait Coll[T] class C extends Comp[C] object Max { - def max[M <: Comp[_ >: M]](x: Coll[_ <: M]): M = ??? - def max[M](x: Coll[_ <: M], cmp: Object): M = ??? + def max[M <: Comp[? >: M]](x: Coll[? <: M]): M = ??? + def max[M](x: Coll[? <: M], cmp: Object): M = ??? val xs: Coll[C] = ??? val m1 = max(xs) val m2 = max(null) diff --git a/tests/pos/i540.scala b/tests/pos/i540.scala index b7540ab2cab4..7fda88506927 100644 --- a/tests/pos/i540.scala +++ b/tests/pos/i540.scala @@ -2,5 +2,5 @@ trait Foo extends Any object Univ { def univ[T <: Foo](x: Array[T]) = {} - def univ2(x: Array[_ <: Foo]) = {} + def univ2(x: Array[? <: Foo]) = {} } diff --git a/tests/pos/i5844.scala b/tests/pos/i5844.scala index ca735de7eaf0..f625abda8599 100644 --- a/tests/pos/i5844.scala +++ b/tests/pos/i5844.scala @@ -6,7 +6,7 @@ package p1 { trait C[X] extends B[X, X & A] object O{ - def m(c: C[_]) = { + def m(c: C[?]) = { val x = c.m() } } @@ -19,7 +19,7 @@ package p2 { trait C[X] extends B[X with A] object O{ - def m(c: C[_]) = { + def m(c: C[?]) = { val x: A = c.m() } } diff --git a/tests/pos/i6033.scala b/tests/pos/i6033.scala index 40e8ca557dc8..974b820c568e 100644 --- a/tests/pos/i6033.scala +++ b/tests/pos/i6033.scala @@ -1,5 +1,5 @@ class Test { - def f(a: Array[_]|Null): Unit = a match { + def f(a: Array[?]|Null): Unit = a match { case x: Array[Int] => } } diff --git a/tests/pos/i6146.scala b/tests/pos/i6146.scala index e13707dcdea3..6421efc78857 100644 --- a/tests/pos/i6146.scala +++ b/tests/pos/i6146.scala @@ -1,13 +1,13 @@ trait BS[T, S <: BS[T, S]] trait IS extends BS[Int, IS] -sealed trait BSElem[T, S <: BS[_, S]] +sealed trait BSElem[T, S <: BS[?, S]] // old error: Type argument S does not conform to upper bound BS[Any, LazyRef(S)] object BSElem { implicit val intStreamShape: BSElem[Int, IS] = ??? } class Ops[A] { - def asJavaSeqStream[S <: BS[_, S]](implicit s: BSElem[A, S]): S = ??? + def asJavaSeqStream[S <: BS[?, S]](implicit s: BSElem[A, S]): S = ??? // old error: Type argument S does not conform to upper bound BS[Any, LazyRef(S)] } diff --git a/tests/pos/i6199a.scala b/tests/pos/i6199a.scala index 3cc2384b708b..56f7f8a04e73 100644 --- a/tests/pos/i6199a.scala +++ b/tests/pos/i6199a.scala @@ -2,7 +2,7 @@ class Encoder[T] { def encode(v: T): String = v.toString } case class ValueWithEncoder[T](value: T, encoder: Encoder[T]) object Test { - val a: Seq[ValueWithEncoder[_]] = Seq.empty + val a: Seq[ValueWithEncoder[?]] = Seq.empty val b = a.map(ve => ve.encoder.encode(ve.value)) val c: Seq[String] = b } diff --git a/tests/pos/i6199c.scala b/tests/pos/i6199c.scala index 85bcb0f04e7e..ca73779d7b81 100644 --- a/tests/pos/i6199c.scala +++ b/tests/pos/i6199c.scala @@ -1,8 +1,8 @@ trait Foo[State] { - def bar(f: Bar[State] => Bar[State]): Foo[_] = this + def bar(f: Bar[State] => Bar[State]): Foo[?] = this } object Foo { - def unit: Foo[_] = new Foo[Any] {} - def doBar: Foo[_] = unit.bar(bar => bar) + def unit: Foo[?] = new Foo[Any] {} + def doBar: Foo[?] = unit.bar(bar => bar) } class Bar[+A] diff --git a/tests/pos/i6849b.scala b/tests/pos/i6849b.scala index 9948fbfbb8cc..08d01f0f3d02 100644 --- a/tests/pos/i6849b.scala +++ b/tests/pos/i6849b.scala @@ -1,5 +1,5 @@ object A { - def unapplySeq(a: Any): Seq[_] = "" + def unapplySeq(a: Any): Seq[?] = "" } def unapply(x: Any) = x match { case A() => } diff --git a/tests/pos/i6854.scala b/tests/pos/i6854.scala index 78ba9c19af7e..a8ca1fa1219c 100644 --- a/tests/pos/i6854.scala +++ b/tests/pos/i6854.scala @@ -4,7 +4,7 @@ object Test { } object Lib { - opaque type IArray2[+T] = Array[_ <: T] + opaque type IArray2[+T] = Array[? <: T] object IArray2 { inline def apply(x: =>Int): IArray2[Int] = Array(x) diff --git a/tests/pos/i7041.scala b/tests/pos/i7041.scala index 458814e3f622..6dde979d9c8a 100644 --- a/tests/pos/i7041.scala +++ b/tests/pos/i7041.scala @@ -4,7 +4,7 @@ extension [T, E <: Throwable](op: => T) inline def rescue (fallback: PartialFunction[E, T]) = try op catch { - case ex: ReturnThrowable[_] => throw ex + case ex: ReturnThrowable[?] => throw ex case ex: E => if (fallback.isDefinedAt(ex)) fallback(ex) else throw ex } diff --git a/tests/pos/i7359.scala b/tests/pos/i7359.scala index 697b20b23cd0..c4bd311be3ca 100644 --- a/tests/pos/i7359.scala +++ b/tests/pos/i7359.scala @@ -112,10 +112,10 @@ object Main: val samPlainWithExtends : SAMPlainWithExtends = () => "Hello, World!" val samPlainWithExtendsAndOverride : SAMPlainWithExtendsAndOverride = () => "Hello, World!" - val samPlainCovariantOut : SAMPlainCovariantOut[_] = () => "Hello, World!" - val samCovariantOut : SAMCovariantOut[_] = () => "Hello, World!" - val samCovariantOutExtends : SAMCovariantOutExtends[_] = () => "Hello, World!" - val samCovariantOutExtendsAndOverride : SAMCovariantOutExtendsAndOverride[_] = () => "Hello, World!" + val samPlainCovariantOut : SAMPlainCovariantOut[?] = () => "Hello, World!" + val samCovariantOut : SAMCovariantOut[?] = () => "Hello, World!" + val samCovariantOutExtends : SAMCovariantOutExtends[?] = () => "Hello, World!" + val samCovariantOutExtendsAndOverride : SAMCovariantOutExtendsAndOverride[?] = () => "Hello, World!" val samPlainContravariantIn : SAMPlainContravariantIn[Int] = (x: Int) => () val samContravariantIn : SAMContravariantIn[Int] = (x: Int) => () diff --git a/tests/pos/i7467.scala b/tests/pos/i7467.scala index 03dbeaaa0595..edc7969da140 100644 --- a/tests/pos/i7467.scala +++ b/tests/pos/i7467.scala @@ -2,9 +2,9 @@ import javax.swing.* import java.awt.* class DuplicateSymbolError_DirectSuperclass extends DefaultListCellRenderer() { - override def getListCellRendererComponent(list: JList[_ <: Object], value: Object, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component = ??? + override def getListCellRendererComponent(list: JList[? <: Object], value: Object, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component = ??? } class DuplicateSymbolError_IndirectInterface extends DefaultListCellRenderer() { - override def getListCellRendererComponent(list: JList[_], value: Object, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component = ??? + override def getListCellRendererComponent(list: JList[?], value: Object, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component = ??? } diff --git a/tests/pos/i7965.scala b/tests/pos/i7965.scala index ee9a9e64a01b..96580886a1a5 100644 --- a/tests/pos/i7965.scala +++ b/tests/pos/i7965.scala @@ -7,18 +7,18 @@ abstract class Test { def x: Has[X] | (Has[Y] & Has[Z]) val y: Has[? >: (X & Y) | (X & Z) <: (X | Y) & (X | Z)] = x - def foo[T <: Has[_]](has: T): T = has + def foo[T <: Has[?]](has: T): T = has foo(x) } // ------------------------------------------- -trait ZLayer[-RIn, +E, +ROut <: Has[_]] { - def >>>[E1 >: E, ROut2 <: Has[_]](that: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2] - def ++[E1 >: E, RIn2, ROut1 >: ROut <: Has[_], ROut2 <: Has[_]](that: ZLayer[RIn2, E1, ROut2]): ZLayer[RIn with RIn2, E1, ROut1 with ROut2] +trait ZLayer[-RIn, +E, +ROut <: Has[?]] { + def >>>[E1 >: E, ROut2 <: Has[?]](that: ZLayer[ROut, E1, ROut2]): ZLayer[RIn, E1, ROut2] + def ++[E1 >: E, RIn2, ROut1 >: ROut <: Has[?], ROut2 <: Has[?]](that: ZLayer[RIn2, E1, ROut2]): ZLayer[RIn with RIn2, E1, ROut1 with ROut2] } object ZLayer { - type NoDeps[+E, +B <: Has[_]] = ZLayer[Any, E, B] + type NoDeps[+E, +B <: Has[?]] = ZLayer[Any, E, B] } type ServiceA = Has[ServiceA.Service] diff --git a/tests/pos/i8031.scala b/tests/pos/i8031.scala index bb1b03bb35b5..0014a07b1516 100644 --- a/tests/pos/i8031.scala +++ b/tests/pos/i8031.scala @@ -3,14 +3,14 @@ object Example extends App { trait Has[A] trait ZIO[-R] { - def provideLayer[R0, R1 <: Has[_]]( + def provideLayer[R0, R1 <: Has[?]]( layer: ZLayer[R0, R1] )(implicit ev: R1 <:< R): ZIO[R0] = ??? } - trait ZLayer[-RIn, +ROut <: Has[_]] { - def ++[RIn2, ROut1 >: ROut <: Has[_], ROut2 <: Has[_]]( + trait ZLayer[-RIn, +ROut <: Has[?]] { + def ++[RIn2, ROut1 >: ROut <: Has[?], ROut2 <: Has[?]]( that: ZLayer[RIn2, ROut2] ): ZLayer[RIn with RIn2, ROut1 with ROut2] = ??? } diff --git a/tests/pos/i8344-2.scala b/tests/pos/i8344-2.scala index 9c4988815edd..695b1c069fb7 100644 --- a/tests/pos/i8344-2.scala +++ b/tests/pos/i8344-2.scala @@ -2,7 +2,7 @@ sealed trait Datatype[T] case class Foo[T <: Tuple](elems: Tuple.Map[T, Datatype]) extends Datatype[T] def g = - val tt: Datatype[_] = ??? + val tt: Datatype[?] = ??? tt match { case Foo(_) => ??? } diff --git a/tests/pos/i8666.scala b/tests/pos/i8666.scala index 307a4617b172..f4a80343d196 100644 --- a/tests/pos/i8666.scala +++ b/tests/pos/i8666.scala @@ -1,7 +1,7 @@ class Foo[A, B]() type FooSnd[X] = X match - case Foo[_, b] => b + case Foo[?, b] => b trait Bar[A]: def bar(h: FooSnd[A]): Int diff --git a/tests/pos/i8955.scala b/tests/pos/i8955.scala index d9f0a1ee9f73..deeadab89d74 100644 --- a/tests/pos/i8955.scala +++ b/tests/pos/i8955.scala @@ -4,7 +4,7 @@ def test[A](as: List[A]) = println(as) def tost[A](a: Class[A]) = println(a) @main def main() = { - val one: One[_] = new One() + val one: One[?] = new One() test(one.getClass(): Class[?]) //this fails val cls = one.getClass() test(cls) //this is ok diff --git a/tests/pos/i8963.scala b/tests/pos/i8963.scala index e8609acd6abc..854d9986968b 100644 --- a/tests/pos/i8963.scala +++ b/tests/pos/i8963.scala @@ -8,7 +8,7 @@ final case class VarDoubles(arr: Array[Double]) extends VarValues[Double, VarDou final case class VarInts(arr: Array[Int]) extends VarValues[Int, VarInts] final case class VarStrs(arr: Array[String]) extends VarValues[String, VarStrs] -def check7(a: VarValues[_,_], b: VarValues[_,_]): Unit = { +def check7(a: VarValues[?,?], b: VarValues[?,?]): Unit = { (a,b) match { case (x:(VarDoubles|VarInts), y:(VarDoubles|VarInts)) => val x0: Iterator[Numeric] = x.arr.iterator diff --git a/tests/pos/implicit-lower-bound.scala b/tests/pos/implicit-lower-bound.scala index 5729c33ecc0b..666a69fbac8f 100644 --- a/tests/pos/implicit-lower-bound.scala +++ b/tests/pos/implicit-lower-bound.scala @@ -6,8 +6,8 @@ object Bar { } class Test { - def get1(implicit lf: List[_ <: Bar]) = {} - def get2(implicit lf: List[_ >: Bar]) = {} + def get1(implicit lf: List[? <: Bar]) = {} + def get2(implicit lf: List[? >: Bar]) = {} get1 get2 diff --git a/tests/pos/implicit-match-nested.scala b/tests/pos/implicit-match-nested.scala index d54f610d60b9..66abef7d3fde 100644 --- a/tests/pos/implicit-match-nested.scala +++ b/tests/pos/implicit-match-nested.scala @@ -8,7 +8,7 @@ object `implicit-match-nested` { implicit val b1: B[Int] = B[Int]() implicit val b2: B[String] = B[String]() - transparent inline def locateB: B[_] = + transparent inline def locateB: B[?] = summonFrom { case _: A[t] => summonFrom { diff --git a/tests/pos/infinite-loop-potential.scala b/tests/pos/infinite-loop-potential.scala index 89a2bdd2a9a2..75001c521a11 100644 --- a/tests/pos/infinite-loop-potential.scala +++ b/tests/pos/infinite-loop-potential.scala @@ -5,6 +5,6 @@ object InfiniteSubtypingLoopPossibility { def c: Any = ??? c match { - case pc: Min[_] => + case pc: Min[?] => } } diff --git a/tests/pos/list-extractor.scala b/tests/pos/list-extractor.scala index 79c622bca06c..bfea573d54ec 100644 --- a/tests/pos/list-extractor.scala +++ b/tests/pos/list-extractor.scala @@ -2,7 +2,7 @@ // from the case I was knowingly fixing, I'm throwing it // in there. object HasArgs { - def boop(params: List[List[_]]) = params match { + def boop(params: List[List[?]]) = params match { case List(List()) => 2 } } diff --git a/tests/pos/open-selftype.scala b/tests/pos/open-selftype.scala index e834f405ec7f..38d8d37f6b41 100644 --- a/tests/pos/open-selftype.scala +++ b/tests/pos/open-selftype.scala @@ -5,4 +5,4 @@ trait Z package squants: trait Quantity[A <: Quantity[A]] { self: A => } - trait TimeDerivative[A <: Quantity[A]] { self: Quantity[_] => } \ No newline at end of file + trait TimeDerivative[A <: Quantity[A]] { self: Quantity[?] => } \ No newline at end of file diff --git a/tests/pos/partialApplications.scala b/tests/pos/partialApplications.scala index fae6849fc3fc..e635760ef1b0 100644 --- a/tests/pos/partialApplications.scala +++ b/tests/pos/partialApplications.scala @@ -10,7 +10,7 @@ object Test { def e = xs - val zs: StringlyHistogram[_] = e + val zs: StringlyHistogram[?] = e type IntMap[Y] = Map[Int, Y] @@ -18,7 +18,7 @@ object Test { val js: IntMap[Boolean] = is - val ks: IntMap[_] = is + val ks: IntMap[?] = is type RMap[X, Y] = Map[Y, X] diff --git a/tests/pos/patmat-extract-tparam.scala b/tests/pos/patmat-extract-tparam.scala index 6417b49c2bb1..3446fbaf862c 100644 --- a/tests/pos/patmat-extract-tparam.scala +++ b/tests/pos/patmat-extract-tparam.scala @@ -3,11 +3,11 @@ trait BoolBip extends Bip[Boolean] class A { def g(x: Boolean): Unit = () - def f(xs: List[Bip[_]]) = xs foreach { case x: BoolBip => g(x.h) } + def f(xs: List[Bip[?]]) = xs foreach { case x: BoolBip => g(x.h) } } class B { def g(x: Boolean): Unit = () def g(x: Int): Unit = () - def f(xs: List[Bip[_]]) = xs foreach { case x: BoolBip => g(x.h) } + def f(xs: List[Bip[?]]) = xs foreach { case x: BoolBip => g(x.h) } } diff --git a/tests/pos/polyalias.scala b/tests/pos/polyalias.scala index f3636ed4bf5c..c87ffd2a2b3d 100644 --- a/tests/pos/polyalias.scala +++ b/tests/pos/polyalias.scala @@ -3,7 +3,7 @@ object Test { type S[X] = scala.Predef.Set[X] - val z: S[_] = ??? + val z: S[?] = ??? type Pair[T] = (T, T) @@ -23,10 +23,10 @@ object Test { val rm: RMap[Int, String] = Map[String, Int]() val rrm: RRMap[Int, String] = Map[Int, String]() - val zz: RMap[_, Int] = Map[Int, String]() + val zz: RMap[?, Int] = Map[Int, String]() val m = Map[Int, String]() - val ts: RMap[_, Int] = m - val us: RMap[String, _] = m - val vs: RMap[_, _] = m + val ts: RMap[?, Int] = m + val us: RMap[String, ?] = m + val vs: RMap[?, ?] = m } diff --git a/tests/pos/pos_valueclasses/t5953.scala b/tests/pos/pos_valueclasses/t5953.scala index e05ec5b48976..b28d0a991621 100644 --- a/tests/pos/pos_valueclasses/t5953.scala +++ b/tests/pos/pos_valueclasses/t5953.scala @@ -5,7 +5,7 @@ trait GenTraversable[+A] trait Traversable[+A] extends GenTraversable[A] trait Vector[A] extends Traversable[A] object Vector { - implicit def cbf[A]: CBF[Vector[_], A, Vector[A]] = ??? + implicit def cbf[A]: CBF[Vector[?], A, Vector[A]] = ??? } package object foo { diff --git a/tests/pos/pos_valueclasses/t7818.scala b/tests/pos/pos_valueclasses/t7818.scala index 8f01ff15056b..111c239853ed 100644 --- a/tests/pos/pos_valueclasses/t7818.scala +++ b/tests/pos/pos_valueclasses/t7818.scala @@ -1,6 +1,6 @@ package t7818 -class Observable1[+T](val asJava: JObservable[_ <: T]) extends AnyVal { +class Observable1[+T](val asJava: JObservable[? <: T]) extends AnyVal { private def foo[X](a: JObservable[X]): JObservable[X] = ??? // was generating a type error as the type of the RHS included an existential // skolem based on the class type parameter `T`, which did not conform @@ -10,7 +10,7 @@ class Observable1[+T](val asJava: JObservable[_ <: T]) extends AnyVal { // Was generating a Ycheck error after ExtensionMethods. // Fixed by having TypeMap go over info of SkolemTypes - private[this] def id(x: JObservable[_ <: T]) = x + private[this] def id(x: JObservable[? <: T]) = x def synchronize2: Observable1[T] = new Observable1(foo(id(asJava))) } diff --git a/tests/pos/printbounds.scala b/tests/pos/printbounds.scala index a3db104f4a33..a563ce1b85ea 100644 --- a/tests/pos/printbounds.scala +++ b/tests/pos/printbounds.scala @@ -3,7 +3,7 @@ class Tree[-T >: Number] class Test { - val x: Tree[_] = ??? + val x: Tree[?] = ??? val y = x // With -Xprint:typer this should print val x: Tree[_] = x // used to print Tree[Nothing], which is confusing. diff --git a/tests/pos/range.scala b/tests/pos/range.scala index 266dbf8602fe..9cc2bd64cb1b 100644 --- a/tests/pos/range.scala +++ b/tests/pos/range.scala @@ -1,8 +1,8 @@ import scala.math.* import collection.immutable.NumericRange object Test { - val r1: scala.collection.immutable.Range.Partial[_, _] = ??? - val r2: scala.Range.Partial[_, _] = r1 + val r1: scala.collection.immutable.Range.Partial[?, ?] = ??? + val r2: scala.Range.Partial[?, ?] = r1 def until(d: BigDecimal, end: BigDecimal): Range.Partial[BigDecimal, NumericRange.Exclusive[BigDecimal]] = new Range.Partial(until(d, end, _)) def until(d: BigDecimal, end: BigDecimal, step: BigDecimal) = Range.BigDecimal(d, end, step) diff --git a/tests/pos/rbtree.scala b/tests/pos/rbtree.scala index ffa44f743137..9d2d10bbf201 100644 --- a/tests/pos/rbtree.scala +++ b/tests/pos/rbtree.scala @@ -27,9 +27,9 @@ import scala.annotation.meta.getter private[collection] object RedBlackTree { - def isEmpty(tree: Tree[_, _]): Boolean = tree eq null + def isEmpty(tree: Tree[?, ?]): Boolean = tree eq null - def contains[A: Ordering](tree: Tree[A, _], x: A): Boolean = lookup(tree, x) ne null + def contains[A: Ordering](tree: Tree[A, ?], x: A): Boolean = lookup(tree, x) ne null def get[A: Ordering, B](tree: Tree[A, B], x: A): Option[B] = lookup(tree, x) match { case null => None case tree => Some(tree.value) @@ -43,12 +43,12 @@ object RedBlackTree { else tree } - def count(tree: Tree[_, _]) = if (tree eq null) 0 else tree.count + def count(tree: Tree[?, ?]) = if (tree eq null) 0 else tree.count /** * Count all the nodes with keys greater than or equal to the lower bound and less than the upper bound. * The two bounds are optional. */ - def countInRange[A](tree: Tree[A, _], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = + def countInRange[A](tree: Tree[A, ?], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = if (tree eq null) 0 else (from, to) match { // with no bounds use this node's count @@ -102,16 +102,16 @@ object RedBlackTree { if (tree.right ne null) _foreach(tree.right, f) } - def foreachKey[A, U](tree:Tree[A,_], f: A => U):Unit = if (tree ne null) _foreachKey(tree,f) + def foreachKey[A, U](tree:Tree[A,?], f: A => U):Unit = if (tree ne null) _foreachKey(tree,f) - private[this] def _foreachKey[A, U](tree: Tree[A, _], f: A => U): Unit = { + private[this] def _foreachKey[A, U](tree: Tree[A, ?], f: A => U): Unit = { if (tree.left ne null) _foreachKey(tree.left, f) f((tree.key)) if (tree.right ne null) _foreachKey(tree.right, f) } def iterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None): Iterator[(A, B)] = new EntriesIterator(tree, start) - def keysIterator[A: Ordering](tree: Tree[A, _], start: Option[A] = None): Iterator[A] = new KeysIterator(tree, start) + def keysIterator[A: Ordering](tree: Tree[A, ?], start: Option[A] = None): Iterator[A] = new KeysIterator(tree, start) def valuesIterator[A: Ordering, B](tree: Tree[A, B], start: Option[A] = None): Iterator[B] = new ValuesIterator(tree, start) @tailrec @@ -122,10 +122,10 @@ object RedBlackTree { else tree } - def isBlack(tree: Tree[_, _]) = (tree eq null) || isBlackTree(tree) + def isBlack(tree: Tree[?, ?]) = (tree eq null) || isBlackTree(tree) - private[this] def isRedTree(tree: Tree[_, _]) = tree.isInstanceOf[RedTree[_, _]] - private[this] def isBlackTree(tree: Tree[_, _]) = tree.isInstanceOf[BlackTree[_, _]] + private[this] def isRedTree(tree: Tree[?, ?]) = tree.isInstanceOf[RedTree[?, ?]] + private[this] def isBlackTree(tree: Tree[?, ?]) = tree.isInstanceOf[BlackTree[?, ?]] private[this] def blacken[A, B](t: Tree[A, B]): Tree[A, B] = if (t eq null) null else t.black @@ -192,7 +192,7 @@ object RedBlackTree { BlackTree(x, xv, tl, tr) } def subl(t: Tree[A, B]) = - if (t.isInstanceOf[BlackTree[_, _]]) t.red + if (t.isInstanceOf[BlackTree[?, ?]]) t.red else sys.error("Defect: invariance violation; expected black, got "+t) def balLeft(x: A, xv: B, tl: Tree[A, B], tr: Tree[A, B]) = if (isRedTree(tl)) { diff --git a/tests/pos/t0095.scala b/tests/pos/t0095.scala index 2123237b5412..1cb146453af0 100644 --- a/tests/pos/t0095.scala +++ b/tests/pos/t0095.scala @@ -3,7 +3,7 @@ case class Success[+T](t: T) extends ParseResult[T] abstract class Nonterminal[Output] { - type SubNonterminal = Nonterminal[_ <: Output] + type SubNonterminal = Nonterminal[? <: Output] def parse: ParseResult[Output] diff --git a/tests/pos/t0654.scala b/tests/pos/t0654.scala index 0d0f2f7deae4..ef6192f02506 100644 --- a/tests/pos/t0654.scala +++ b/tests/pos/t0654.scala @@ -1,5 +1,5 @@ object Test { class Foo[T] - type C[T] = Foo[_ <: T] // error: parameter type T of type alias does not appear as type argument of the aliased class Foo + type C[T] = Foo[? <: T] // error: parameter type T of type alias does not appear as type argument of the aliased class Foo val a: C[AnyRef] = new Foo[AnyRef] } diff --git a/tests/pos/t0905.scala b/tests/pos/t0905.scala index 3800c6e0ba10..729f7ac973a0 100644 --- a/tests/pos/t0905.scala +++ b/tests/pos/t0905.scala @@ -1,6 +1,6 @@ object Test { trait A[T] - def f(implicit p: A[_]) = null - implicit val x: A[_] = null + def f(implicit p: A[?]) = null + implicit val x: A[?] = null println(f) } diff --git a/tests/pos/t1048.scala b/tests/pos/t1048.scala index b8694b38e694..68c66e4de01c 100644 --- a/tests/pos/t1048.scala +++ b/tests/pos/t1048.scala @@ -1,9 +1,9 @@ trait T[U] { - def x: T[_ <: U] + def x: T[? <: U] } object T { - def unapply[U](t: T[U]): Option[T[_ <: U]] = Some(t.x) + def unapply[U](t: T[U]): Option[T[? <: U]] = Some(t.x) } object Test { diff --git a/tests/pos/t1107a.scala b/tests/pos/t1107a.scala index 0bf40bb4cc6e..27833a41ecc7 100644 --- a/tests/pos/t1107a.scala +++ b/tests/pos/t1107a.scala @@ -1,5 +1,5 @@ object F { - type AnyClass = Class[_] + type AnyClass = Class[?] def tryf[T](ignore: List[AnyClass])(f: => T): Any = { try { f diff --git a/tests/pos/t1107b/T.scala b/tests/pos/t1107b/T.scala index 5889d43548a0..57bb442705e6 100644 --- a/tests/pos/t1107b/T.scala +++ b/tests/pos/t1107b/T.scala @@ -2,6 +2,6 @@ sealed trait Top sealed trait Sub extends Top trait C { private object P extends Sub - def bob(): Class[_] = P.getClass + def bob(): Class[?] = P.getClass def bob2() = O.d(P) } diff --git a/tests/pos/t1439.scala b/tests/pos/t1439.scala index 0efcc74b6545..e6cf2e58dd88 100644 --- a/tests/pos/t1439.scala +++ b/tests/pos/t1439.scala @@ -3,6 +3,6 @@ class View[C[A]] { } object Test { (null: Any) match { - case v: View[_] => + case v: View[?] => } } diff --git a/tests/pos/t1560.scala b/tests/pos/t1560.scala index dd76392e6679..40538aca2b57 100644 --- a/tests/pos/t1560.scala +++ b/tests/pos/t1560.scala @@ -4,7 +4,7 @@ object Test extends App { def t: T } - def b: Option[C[_]] = null + def b: Option[C[?]] = null def c = b match { case Some(b) => b.t diff --git a/tests/pos/t1614/foo.scala b/tests/pos/t1614/foo.scala index 6a45fb76d919..30778c96204e 100644 --- a/tests/pos/t1614/foo.scala +++ b/tests/pos/t1614/foo.scala @@ -1,12 +1,12 @@ // foo.scala trait Foo { - def foo(arg: List[_]): Unit + def foo(arg: List[?]): Unit } trait FooImpl extends Foo { - def foo(arg: List[_]): Unit = {} + def foo(arg: List[?]): Unit = {} } trait AbstractOverrideFoo extends Foo { - abstract override def foo(arg: List[_]): Unit = { + abstract override def foo(arg: List[?]): Unit = { super.foo(arg) } } diff --git a/tests/pos/t1786-counter.scala b/tests/pos/t1786-counter.scala index a2431343d1b7..8962709deacb 100644 --- a/tests/pos/t1786-counter.scala +++ b/tests/pos/t1786-counter.scala @@ -2,13 +2,13 @@ trait ShapeLevel object Fail { abstract class ProductNodeShape[Level <: ShapeLevel, C, M <: C, U <: C, P <: C] extends Shape[Level, M, U, P] { - def copy(shapes: Seq[Shape[_, _, _, _]]): Shape[Level, _, _, _] + def copy(shapes: Seq[Shape[?, ?, ?, ?]]): Shape[Level, ?, ?, ?] } abstract class Shape[Level <: ShapeLevel, -Mixed_, Unpacked_, Packed_] - final class TupleShape[Level <: ShapeLevel, M <: Product, U <: Product, P <: Product](val shapes: Shape[_, _, _, _]*) extends ProductNodeShape[Level, Product, M, U, P] { - def copy(shapes: Seq[Shape[_, _, _, _]]): Shape[Level, _, _, _] = ??? + final class TupleShape[Level <: ShapeLevel, M <: Product, U <: Product, P <: Product](val shapes: Shape[?, ?, ?, ?]*) extends ProductNodeShape[Level, Product, M, U, P] { + def copy(shapes: Seq[Shape[?, ?, ?, ?]]): Shape[Level, ?, ?, ?] = ??? } trait ShapeLevel @@ -18,11 +18,11 @@ object Ok { abstract class Shape[Level <: ShapeLevel, -Mixed_, Unpacked_, Packed_] abstract class ProductNodeShape[Level <: ShapeLevel, C, M <: C, U <: C, P <: C] extends Shape[Level, M, U, P] { - def copy(shapes: Seq[Shape[_, _, _, _]]): Shape[Level, _, _, _] + def copy(shapes: Seq[Shape[?, ?, ?, ?]]): Shape[Level, ?, ?, ?] } - final class TupleShape[Level <: ShapeLevel, M <: Product, U <: Product, P <: Product](val shapes: Shape[_, _, _, _]*) extends ProductNodeShape[Level, Product, M, U, P] { - def copy(shapes: Seq[Shape[_, _, _, _]]): Shape[Level, _, _, _] = ??? + final class TupleShape[Level <: ShapeLevel, M <: Product, U <: Product, P <: Product](val shapes: Shape[?, ?, ?, ?]*) extends ProductNodeShape[Level, Product, M, U, P] { + def copy(shapes: Seq[Shape[?, ?, ?, ?]]): Shape[Level, ?, ?, ?] = ??? } } diff --git a/tests/pos/t1786-cycle.scala b/tests/pos/t1786-cycle.scala index 9de149fbc50b..20e2eacc2c2b 100644 --- a/tests/pos/t1786-cycle.scala +++ b/tests/pos/t1786-cycle.scala @@ -2,7 +2,7 @@ trait GenTraversableLike[+A, +Repr] extends Any object O { (null: Any) match { - case _: LongTraversableLike[_] => + case _: LongTraversableLike[?] => } } diff --git a/tests/pos/t1843.scala b/tests/pos/t1843.scala index 871b21346cc2..915897cfd20f 100644 --- a/tests/pos/t1843.scala +++ b/tests/pos/t1843.scala @@ -9,7 +9,7 @@ object Crash { case object IntegerUpdateType extends UpdateType[Integer] //However this method will cause a crash - def crash(updates: List[StateUpdate[_]]): Unit = { + def crash(updates: List[StateUpdate[?]]): Unit = { updates match { case Nil => case u::us => diff --git a/tests/pos/t1896/D0.scala b/tests/pos/t1896/D0.scala index 6b3150d96916..3e8c9f930c9b 100644 --- a/tests/pos/t1896/D0.scala +++ b/tests/pos/t1896/D0.scala @@ -3,7 +3,7 @@ package p class X[T] trait A { - def m(s:X[_]): Unit = {} + def m(s:X[?]): Unit = {} } trait B extends A { diff --git a/tests/pos/t1974.scala b/tests/pos/t1974.scala index 3f4d41e7fbbf..7a03cff34b74 100644 --- a/tests/pos/t1974.scala +++ b/tests/pos/t1974.scala @@ -1,20 +1,20 @@ object Broken { - private var map = Map[Class[_], String]() + private var map = Map[Class[?], String]() - def addToMap(c : Class[_], s : String) = map += (c -> s) - def fetch(c : Class[_]) = map(c) + def addToMap(c : Class[?], s : String) = map += (c -> s) + def fetch(c : Class[?]) = map(c) } object Works { - private var map = Map[Class[_], String]() + private var map = Map[Class[?], String]() - def addToMap(c : Class[_], s : String) = map += ((c, s)) - def fetch(c : Class[_]) = map(c) + def addToMap(c : Class[?], s : String) = map += ((c, s)) + def fetch(c : Class[?]) = map(c) } object Works2 { - private var map = Map[Class[_], String]() + private var map = Map[Class[?], String]() - def addToMap(c : Class[_], s : String) = map += ((c : Class[_]) -> s) - def fetch(c : Class[_]) = map(c) + def addToMap(c : Class[?], s : String) = map += ((c : Class[?]) -> s) + def fetch(c : Class[?]) = map(c) } diff --git a/tests/pos/t2038.scala b/tests/pos/t2038.scala index 8c8ca44da3b3..7ebc8dd5bc45 100644 --- a/tests/pos/t2038.scala +++ b/tests/pos/t2038.scala @@ -1,5 +1,5 @@ class Test { List(Some(classOf[java.lang.Integer]), Some(classOf[Int])).map { - case Some(f: Class[_]) => f.cast(???) + case Some(f: Class[?]) => f.cast(???) } } diff --git a/tests/pos/t2094.scala b/tests/pos/t2094.scala index 6b6c4f077a69..4cc349db97ef 100644 --- a/tests/pos/t2094.scala +++ b/tests/pos/t2094.scala @@ -17,7 +17,7 @@ object Test extends App { // one error found } sealed trait Value { - def getType: Option[Class[_]] + def getType: Option[Class[?]] } case class UnknownValue() extends Value { @@ -26,6 +26,6 @@ case class UnknownValue() extends Value { // def getType: Option[Class[_]] = None } -case class KnownType(typ: Class[_]) extends Value { +case class KnownType(typ: Class[?]) extends Value { def getType = Some(typ) } diff --git a/tests/pos/t2168.scala b/tests/pos/t2168.scala index 21afb239a094..8c699b1873c8 100644 --- a/tests/pos/t2168.scala +++ b/tests/pos/t2168.scala @@ -1,4 +1,4 @@ object Test extends App { - def foo1(x: AnyRef) = x match { case x: Function0[_] => x() } + def foo1(x: AnyRef) = x match { case x: Function0[?] => x() } def foo2(x: AnyRef) = x match { case x: Function0[Any] => x() } } diff --git a/tests/pos/t2421_delitedsl.scala b/tests/pos/t2421_delitedsl.scala index 85dd67b53ce0..c423ce2f5215 100644 --- a/tests/pos/t2421_delitedsl.scala +++ b/tests/pos/t2421_delitedsl.scala @@ -16,7 +16,7 @@ trait DeliteDSL { // Test.xAlready below: DeliteCollection[T=DeliteInt] -> P=DeliteInt <: Forcible[T=DeliteInt], as T=DeliteInt <~< P=DeliteInt // this would required DeliteInt <: Forcible[Int] with Forcible[DeliteInt] - def headProxy[P <: Forcible[_]](implicit w: T <~< P): P = w(xs.head) + def headProxy[P <: Forcible[?]](implicit w: T <~< P): P = w(xs.head) } // If T is already a proxy (it is forcible), the compiler should use // forcibleIdentity to deduce that P=T. If T is Int, the compiler diff --git a/tests/pos/t2425.scala b/tests/pos/t2425.scala index 477d5467aab3..8d925fb34918 100644 --- a/tests/pos/t2425.scala +++ b/tests/pos/t2425.scala @@ -3,8 +3,8 @@ class D extends B object Test extends App { def foo[T](bar: T) = { bar match { - case _: Array[Array[_]] => println("array 2d") - case _: Array[_] => println("array 1d") + case _: Array[Array[?]] => println("array 2d") + case _: Array[?] => println("array 1d") case _ => println("something else") } } diff --git a/tests/pos/t2435.scala b/tests/pos/t2435.scala index 090294a5ac9b..e197f5228ca9 100644 --- a/tests/pos/t2435.scala +++ b/tests/pos/t2435.scala @@ -24,5 +24,5 @@ object Test { println("\nDoesn't compile:") val a3 = FNil.chain("a").chain("a").chain("a") - val a4: FConstant[_ <: FConstant[_ <: FConstant[FNil.type]]] = a3 + val a4: FConstant[? <: FConstant[? <: FConstant[FNil.type]]] = a3 } diff --git a/tests/pos/t2504.scala b/tests/pos/t2504.scala index 72117174c844..449e86bdefad 100644 --- a/tests/pos/t2504.scala +++ b/tests/pos/t2504.scala @@ -1,6 +1,6 @@ object Test { val zs = Array("abc") - val ys: Iterable[_] = Array("abc") + val ys: Iterable[?] = Array("abc") val xs = Array("abc") xs sameElements Array("abc") } diff --git a/tests/pos/t2545.scala b/tests/pos/t2545.scala index 6ad994223c49..8ea482647442 100644 --- a/tests/pos/t2545.scala +++ b/tests/pos/t2545.scala @@ -4,7 +4,7 @@ trait Frog[T] { } trait OnlyWithFrogs { - self: Frog[_] => + self: Frog[?] => def sizeStr = size.toString } diff --git a/tests/pos/t2613.scala b/tests/pos/t2613.scala index 17ebe2d7e9bf..22157a95395a 100644 --- a/tests/pos/t2613.scala +++ b/tests/pos/t2613.scala @@ -5,7 +5,7 @@ object Test { abstract class MyRelation [R <: Row, +Relation <: MyRelation[R, Relation]] - type M = MyRelation[_ <: Row, _ <: MyRelation[_, _]] + type M = MyRelation[? <: Row, ? <: MyRelation[?, ?]] val (x,y): (String, M) = null } diff --git a/tests/pos/t2635.scala b/tests/pos/t2635.scala index 7cd55313561a..6ea77205dd9e 100644 --- a/tests/pos/t2635.scala +++ b/tests/pos/t2635.scala @@ -2,12 +2,12 @@ abstract class Base object Test { - def run(c: Class[_ <: Base]): Unit = { + def run(c: Class[? <: Base]): Unit = { } def main(args: Array[String]): Unit = { - val sc: Option[Class[_ <: Base]] = Some(classOf[Base]) + val sc: Option[Class[? <: Base]] = Some(classOf[Base]) sc match { case Some(c) => run(c) case None => diff --git a/tests/pos/t2669.scala b/tests/pos/t2669.scala index 609e88786843..003ef19a466a 100644 --- a/tests/pos/t2669.scala +++ b/tests/pos/t2669.scala @@ -2,7 +2,7 @@ // dies in classfile parser while parsing java.util.Vector(requested by bakend) object Test2669 { - def test[T](l: java.util.ArrayList[_ <: T]) = 1 + def test[T](l: java.util.ArrayList[? <: T]) = 1 test(new java.util.ArrayList[String]()) } diff --git a/tests/pos/t2683.scala b/tests/pos/t2683.scala index 4ba34b554a91..ed305cf6c6bc 100644 --- a/tests/pos/t2683.scala +++ b/tests/pos/t2683.scala @@ -2,6 +2,6 @@ class A class B extends A object Test { - val c: Class[_ <: A] = Class.forName("B").asSubclass(classOf[A]) - val x: Option[Class[_ <: A]] = Some(3).map { case _ => c } + val c: Class[? <: A] = Class.forName("B").asSubclass(classOf[A]) + val x: Option[Class[? <: A]] = Some(3).map { case _ => c } } diff --git a/tests/pos/t3577.scala b/tests/pos/t3577.scala index 754ed01f0174..31b02f30c66f 100644 --- a/tests/pos/t3577.scala +++ b/tests/pos/t3577.scala @@ -1,6 +1,6 @@ case class Check[A](val value: A) -case class C2(checks: Check[_]*); +case class C2(checks: Check[?]*); object C { def m(x : C2): Any = (null: Any) match { diff --git a/tests/pos/t3866.scala b/tests/pos/t3866.scala index f1f64edb9597..d452bf6336ef 100644 --- a/tests/pos/t3866.scala +++ b/tests/pos/t3866.scala @@ -2,8 +2,8 @@ abstract class ImplicitRepeated { trait T[+A, +B] trait X - def f[N, R <: List[_]](elems: T[N, R]*): Unit // alternative a) - def f[N, R <: List[_]](props: String, elems: T[N, R]*): Unit // alternative b) + def f[N, R <: List[?]](elems: T[N, R]*): Unit // alternative a) + def f[N, R <: List[?]](props: String, elems: T[N, R]*): Unit // alternative b) // the following implicit causes "cannot be applied" errors implicit def xToRight(r: X): T[Nothing, X] = null diff --git a/tests/pos/t3880.scala b/tests/pos/t3880.scala index d7b567e1901a..067bf5dbd1ad 100644 --- a/tests/pos/t3880.scala +++ b/tests/pos/t3880.scala @@ -8,10 +8,10 @@ final class C1[+B] extends Bar[B] { // (That is good news, but is sound only because C1 is final; see #3989 // and compare with i3989a.scala. private[this] def f1(x: Bar[B]): Unit = x match { - case x: C1[_] => g(x) + case x: C1[?] => g(x) } // this one crashes. private[this] def f2(x: Bar[B]): Unit = x match { - case x: C1[_] => f2(x) + case x: C1[?] => f2(x) } } diff --git a/tests/pos/t3960.scala b/tests/pos/t3960.scala index 5c658e9fbc75..e2ec89c537ec 100644 --- a/tests/pos/t3960.scala +++ b/tests/pos/t3960.scala @@ -1,7 +1,7 @@ class A { class C[x] - val cs = new scala.collection.mutable.HashMap[C[_], Int] - def c: C[_] = sys.error("") - val eval: C[_] = c + val cs = new scala.collection.mutable.HashMap[C[?], Int] + def c: C[?] = sys.error("") + val eval: C[?] = c cs(c) += 1 } diff --git a/tests/pos/t4070.scala b/tests/pos/t4070.scala index a9777f02ed20..af8a6a67478d 100644 --- a/tests/pos/t4070.scala +++ b/tests/pos/t4070.scala @@ -1,7 +1,7 @@ package a { // method before classes trait Foo { - def crash(x: Dingus[_]): Unit = x match { case m: Bippy[tv] => () } + def crash(x: Dingus[?]): Unit = x match { case m: Bippy[tv] => () } class Dingus[T] class Bippy[CC[X] <: Seq[X]]() extends Dingus[CC[Int]] @@ -14,7 +14,7 @@ package b { class Dingus[T] class Bippy[CC[X] <: Seq[X]]() extends Dingus[CC[Int]] - def crash(x: Dingus[_]): Unit = x match { case m: Bippy[tv] => () } + def crash(x: Dingus[?]): Unit = x match { case m: Bippy[tv] => () } } } diff --git a/tests/pos/t4070b.scala b/tests/pos/t4070b.scala index d6851b8cca26..bf2ad7ee7fed 100644 --- a/tests/pos/t4070b.scala +++ b/tests/pos/t4070b.scala @@ -10,16 +10,16 @@ package a { } object Test { - def f(x: DeliteOp[_]) = x match { - case map: DeliteOpMap[_,_,_] => map.alloc.Type + def f(x: DeliteOp[?]) = x match { + case map: DeliteOpMap[?,?,?] => map.alloc.Type } } } package b { object Test { - def f(x: DeliteOp[_]) = x match { - case map: DeliteOpMap[_,_,_] => map.alloc.Type + def f(x: DeliteOp[?]) = x match { + case map: DeliteOpMap[?,?,?] => map.alloc.Type } } diff --git a/tests/pos/t4579.scala b/tests/pos/t4579.scala index 4e76ccf2d0de..c605e69526bd 100644 --- a/tests/pos/t4579.scala +++ b/tests/pos/t4579.scala @@ -288,7 +288,7 @@ object LispAny extends Lisp { } def asList(x: Data): List[Data] = x match { - case y: List[_] => y + case y: List[?] => y case _ => lispError("malformed list: " + x) } diff --git a/tests/pos/t4757/B_3.scala b/tests/pos/t4757/B_3.scala index b50d1cd83473..0245190322da 100644 --- a/tests/pos/t4757/B_3.scala +++ b/tests/pos/t4757/B_3.scala @@ -1,3 +1,3 @@ object C { - def x: Seq[S[_]] = A.ss + def x: Seq[S[?]] = A.ss } diff --git a/tests/pos/t4757/P_1.scala b/tests/pos/t4757/P_1.scala index 8f01a4b66974..39eb2e8c505a 100644 --- a/tests/pos/t4757/P_1.scala +++ b/tests/pos/t4757/P_1.scala @@ -1,6 +1,6 @@ trait S[T] object P { - def x(t: Int)(ss: Seq[S[_]]): Seq[S[_]] = ss + def x(t: Int)(ss: Seq[S[?]]): Seq[S[?]] = ss } diff --git a/tests/pos/t4869.scala b/tests/pos/t4869.scala index f84aa4ed079e..4beb78196337 100644 --- a/tests/pos/t4869.scala +++ b/tests/pos/t4869.scala @@ -3,6 +3,6 @@ class C[T] class A { - def f[T](x: T): C[_ <: T] = null + def f[T](x: T): C[? <: T] = null def g = List(1d) map f } diff --git a/tests/pos/t5029.scala b/tests/pos/t5029.scala index f32d0c650089..d00872121200 100644 --- a/tests/pos/t5029.scala +++ b/tests/pos/t5029.scala @@ -1,3 +1,3 @@ object Test { - (Vector(): Seq[_]) match { case List() => true; case Nil => false } + (Vector(): Seq[?]) match { case List() => true; case Nil => false } } diff --git a/tests/pos/t5120.scala b/tests/pos/t5120.scala index 5ec632d73051..b1562858a14d 100644 --- a/tests/pos/t5120.scala +++ b/tests/pos/t5120.scala @@ -11,14 +11,14 @@ class Test { def transform[T](x: T) = x - def test(compiledSettings: Seq[Compiled[_]]) = { + def test(compiledSettings: Seq[Compiled[?]]) = { compiledSettings flatMap { cs => // cd: Compiled[_] in both versions (cs.settings map { s => // cs.settings: Seq[Compiled[$1]] in trunk, Seq[Compiled[$1]] forSome $1 in 2.9.1 // s: Pair[$1] in trunk, Pair[$1] in 2.9.1 val t = transform(s.v) // t: ScopedKey[_] in trunk, ScopedKey[$1] in 2.9.1 foo(s.k, t) t - }) : Seq[ScopedKey[_]] + }) : Seq[ScopedKey[?]] } } diff --git a/tests/pos/t5127.scala b/tests/pos/t5127.scala index c2f3b923f159..f457e28c5fb5 100644 --- a/tests/pos/t5127.scala +++ b/tests/pos/t5127.scala @@ -2,7 +2,7 @@ package foo { trait Abstract1[C <: Abstract2[C]] trait Abstract2[C <: Abstract2[C]] extends Abstract1[C] class Parametrized1[T] extends Abstract1[Parametrized2[T]] { - def bar(a: AnyRef): Unit = { a match { case d: Parametrized1[_] => println("ok") } } + def bar(a: AnyRef): Unit = { a match { case d: Parametrized1[?] => println("ok") } } } class Parametrized2[T] extends Parametrized1[T] with Abstract2[Parametrized2[T]] } diff --git a/tests/pos/t5240.scala b/tests/pos/t5240.scala index 065d175f2f80..53d8c1443ca5 100644 --- a/tests/pos/t5240.scala +++ b/tests/pos/t5240.scala @@ -6,6 +6,6 @@ package object foo { - var labels: Array[_ <: String] = null + var labels: Array[? <: String] = null } diff --git a/tests/pos/t5330.scala b/tests/pos/t5330.scala index 24aab7733b82..677c1cd530d4 100644 --- a/tests/pos/t5330.scala +++ b/tests/pos/t5330.scala @@ -9,14 +9,14 @@ trait M[A] extends FM[A] { trait N[A] extends FM[A] object test { - def kaboom(xs: M[_]) = xs map (x => ()) // missing parameter type. + def kaboom(xs: M[?]) = xs map (x => ()) // missing parameter type. def okay1[A](xs: M[A]) = xs map (x => ()) - def okay2(xs: FM[_]) = xs map (x => ()) - def okay3(xs: N[_]) = xs map (x => ()) + def okay2(xs: FM[?]) = xs map (x => ()) + def okay3(xs: N[?]) = xs map (x => ()) } -class CC2(xs: List[_]) { +class CC2(xs: List[?]) { def f(x1: Any, x2: Any) = null def g = xs map (x => f(x, x)) } diff --git a/tests/pos/t5330c.scala b/tests/pos/t5330c.scala index af31f3dfd116..d82d33139fe0 100644 --- a/tests/pos/t5330c.scala +++ b/tests/pos/t5330c.scala @@ -1,5 +1,5 @@ object t5330c { - val s: Set[_ >: Char] = Set('A') + val s: Set[? >: Char] = Set('A') s forall ("ABC" contains _) s.forall( c => "ABC".toSeq.contains( c )) } diff --git a/tests/pos/t5399.scala b/tests/pos/t5399.scala index 0e7cce3c1776..9f8c1d5247bf 100644 --- a/tests/pos/t5399.scala +++ b/tests/pos/t5399.scala @@ -4,7 +4,7 @@ class Test { case class CaseClass[T](x: T) - def break(existB: B[_]) = + def break(existB: B[?]) = CaseClass(existB.a) match { case CaseClass(_) => } } @@ -21,7 +21,7 @@ class Foo { val scalaHome: Setting[Option[String]] = null val scalaVersion: Setting[String] = null - def testPatternMatch(s: Setting[_]): Unit = { + def testPatternMatch(s: Setting[?]): Unit = { s.key match { case ScopedKey1(scalaHome.key | scalaVersion.key) => () } @@ -29,7 +29,7 @@ class Foo { } class Test2 { - type AnyCyclic = Execute[Task]#CyclicException[_] + type AnyCyclic = Execute[Task]#CyclicException[?] trait Task[T] @@ -39,7 +39,7 @@ class Test2 { def convertCyclic(c: AnyCyclic): String = (c.caller, c.target) match { - case (caller: Task[_], target: Task[_]) => "bazinga!" + case (caller: Task[?], target: Task[?]) => "bazinga!" } } diff --git a/tests/pos/t5399a.scala b/tests/pos/t5399a.scala index c40cef4f961b..4a69f33d585b 100644 --- a/tests/pos/t5399a.scala +++ b/tests/pos/t5399a.scala @@ -11,7 +11,7 @@ class Foo { val scalaHome: Setting[Option[String]] = null val scalaVersion: Setting[String] = null - def testPatternMatch(s: Setting[_]): Unit = { + def testPatternMatch(s: Setting[?]): Unit = { s.key match { case ScopedKey1(scalaHome.key | scalaVersion.key) => () } diff --git a/tests/pos/t5504/s_1.scala b/tests/pos/t5504/s_1.scala index 35cb2c8bae8d..3df76241ce80 100644 --- a/tests/pos/t5504/s_1.scala +++ b/tests/pos/t5504/s_1.scala @@ -1,4 +1,4 @@ // a.scala package object foo { - val m: List[_] = Nil + val m: List[?] = Nil } diff --git a/tests/pos/t5862.scala b/tests/pos/t5862.scala index 3d3090cba11c..a1bcc1a4147b 100644 --- a/tests/pos/t5862.scala +++ b/tests/pos/t5862.scala @@ -24,7 +24,7 @@ class MapReduceJob { trait DataSource import scala.collection.mutable.{ Set as MSet, Map as MMap } - private val mappers: MMap[DataSource, MSet[TaggedMapper[_, _, _]]] = MMap.empty + private val mappers: MMap[DataSource, MSet[TaggedMapper[?, ?, ?]]] = MMap.empty def addTaggedMapper[A, K, V](input: DataSource, m: TaggedMapper[A, K, V]): Unit = { if (!mappers.contains(input)) diff --git a/tests/pos/t6022.scala b/tests/pos/t6022.scala index 87f7cbf3b2f2..2910854d1ffc 100644 --- a/tests/pos/t6022.scala +++ b/tests/pos/t6022.scala @@ -1,7 +1,7 @@ class Test { (null: Any) match { case x: AnyRef if false => - case list: Option[_] => + case list: Option[?] => case product: Product => // change Product to String and it's all good } } diff --git a/tests/pos/t6084.scala b/tests/pos/t6084.scala index 1107d9a03885..f76aa2bca83d 100644 --- a/tests/pos/t6084.scala +++ b/tests/pos/t6084.scala @@ -3,9 +3,9 @@ package object foo { type X[T, U] = (T => U) } package foo { // Note that Foo must be final because of #3989. final class Foo[T, U](val d: T => U) extends (T => U) { - def f1(r: X[T, U]) = r match { case x: Foo[_,_] => x.d } // inferred ok - def f2(r: X[T, U]): (T => U) = r match { case x: Foo[_,_] => x.d } // dealiased ok - def f3(r: X[T, U]): X[T, U] = r match { case x: Foo[_,_] => x.d } // alias not ok + def f1(r: X[T, U]) = r match { case x: Foo[?,?] => x.d } // inferred ok + def f2(r: X[T, U]): (T => U) = r match { case x: Foo[?,?] => x.d } // dealiased ok + def f3(r: X[T, U]): X[T, U] = r match { case x: Foo[?,?] => x.d } // alias not ok def apply(x: T): U = d(x) diff --git a/tests/pos/t6145.scala b/tests/pos/t6145.scala index 4161a24b5698..08e78df80e07 100644 --- a/tests/pos/t6145.scala +++ b/tests/pos/t6145.scala @@ -2,7 +2,7 @@ object Test { // the existential causes a cast and the cast makes searchClass not be in tail position // can we get rid of the useless cast? @annotation.tailrec - final def searchClass: Class[_] = { + final def searchClass: Class[?] = { "packageName" match { case _ => searchClass diff --git a/tests/pos/t6184.scala b/tests/pos/t6184.scala index 386399963e30..0b174a9ea8c8 100644 --- a/tests/pos/t6184.scala +++ b/tests/pos/t6184.scala @@ -2,6 +2,6 @@ trait Foo[TroubleSome] { type T <: Foo[TroubleSome] this match { - case e: Foo[_]#T => ??? + case e: Foo[?]#T => ??? } } diff --git a/tests/pos/t6205.scala b/tests/pos/t6205.scala index 52078bd5f46f..126a18c33b08 100644 --- a/tests/pos/t6205.scala +++ b/tests/pos/t6205.scala @@ -1,7 +1,7 @@ // original code by reporter class A[T] class Test1 { - def x(backing: Map[A[_], Any]) = + def x(backing: Map[A[?], Any]) = for( (k: A[kt], v) <- backing) yield (k: A[kt]) } @@ -11,7 +11,7 @@ class Test1 { case class Holder[A](a: A) class Mapped[A] { def map[T](f: Holder[A] => T): Iterable[T] = ??? } class Test2 { - def works(backing: Mapped[A[_]]): Iterable[A[_]] + def works(backing: Mapped[A[?]]): Iterable[A[?]] = backing.map(x => x match {case Holder(k: A[kt]) => (k: A[kt])} ) diff --git a/tests/pos/t6499.scala b/tests/pos/t6499.scala index db376572ee28..42cfe3834618 100644 --- a/tests/pos/t6499.scala +++ b/tests/pos/t6499.scala @@ -1,3 +1,3 @@ object Test { - Map(): Map[_, Int] with Map[_, Int] + Map(): Map[?, Int] with Map[?, Int] } diff --git a/tests/pos/t6963c.scala b/tests/pos/t6963c.scala index 9154c0506d23..6effd4082065 100644 --- a/tests/pos/t6963c.scala +++ b/tests/pos/t6963c.scala @@ -2,22 +2,22 @@ // import collection.Seq object Test { - def f1(x: Any) = x.isInstanceOf[Seq[_]] + def f1(x: Any) = x.isInstanceOf[Seq[?]] def f2(x: Any) = x match { - case _: Seq[_] => true + case _: Seq[?] => true case _ => false } def f3(x: Any) = x match { - case _: Array[_] => true + case _: Array[?] => true case _ => false } - def f4(x: Any) = x.isInstanceOf[Iterable[_]] + def f4(x: Any) = x.isInstanceOf[Iterable[?]] def f5(x1: Any, x2: Any, x3: AnyRef) = (x1, x2, x3) match { - case (Some(_: Seq[_]), Nil, _) => 1 - case (None, List(_: List[_], _), _) => 2 + case (Some(_: Seq[?]), Nil, _) => 1 + case (None, List(_: List[?], _), _) => 2 case _ => 3 } diff --git a/tests/pos/t7689.scala b/tests/pos/t7689.scala index 022e7ab7a01f..712d3d5d563a 100644 --- a/tests/pos/t7689.scala +++ b/tests/pos/t7689.scala @@ -3,5 +3,5 @@ object A { // This wasn't happening since e28c3edda4. That commit encoded upper/lower // bounds of Any/Nothing as EmptyTree, which were triggering an .isEmpty // check in Namers#TypeTreeSubstitutor - def x(f: List[_] => Int = _ => 3) = 9 + def x(f: List[?] => Int = _ => 3) = 9 } diff --git a/tests/pos/t7694.scala b/tests/pos/t7694.scala index 9852d5ec79d8..82c4a19b4e76 100644 --- a/tests/pos/t7694.scala +++ b/tests/pos/t7694.scala @@ -7,7 +7,7 @@ trait L[A2, B2 <: A2] { object Lub { // use named args transforms to include TypeTree() in the AST before refchecks. - def foo(a: L[_, _], b: Any) = 0 + def foo(a: L[?, ?], b: Any) = 0 foo(b = 0, a = if (true) (null: L[A, A]) else (null: L[B, B])) diff --git a/tests/pos/t7716.scala b/tests/pos/t7716.scala index 7f3c155a3e8f..ceccf5735579 100644 --- a/tests/pos/t7716.scala +++ b/tests/pos/t7716.scala @@ -1,16 +1,16 @@ object Test { def test: Unit = { - val e: Enum[_] = java.util.concurrent.TimeUnit.SECONDS + val e: Enum[?] = java.util.concurrent.TimeUnit.SECONDS e match { case x => println(x) } trait TA[X <: CharSequence] - val ta: TA[_] = new TA[String] {} + val ta: TA[?] = new TA[String] {} ta match { case _ => println("hi") } - def f(ta: TA[_]) = ta match { case _ => "hi" } + def f(ta: TA[?]) = ta match { case _ => "hi" } } } diff --git a/tests/pos/t7983.scala b/tests/pos/t7983.scala index fbeb7d3c59a8..9a7cfa3663c2 100644 --- a/tests/pos/t7983.scala +++ b/tests/pos/t7983.scala @@ -10,20 +10,20 @@ class DivergenceTest { class Shape2[Level <: ShapeLevel, -M, U] - implicit final def columnBaseShape[Level >: Flat <: ShapeLevel, T, C <: ColumnBase[_]] + implicit final def columnBaseShape[Level >: Flat <: ShapeLevel, T, C <: ColumnBase[?]] (implicit ev: C <:< ColumnBase[T] ): Shape2[Level, C, T] = ??? implicit final def intShape[Level <: ShapeLevel, T]: Shape2[Level, Int, Int] = ??? implicit final def tuple2Shape[Level <: ShapeLevel, M1,M2, U1,U2] - (implicit u1: Shape2[_ <: Level, M1, U1], - u2: Shape2[_ <: Level, M2, U2] + (implicit u1: Shape2[? <: Level, M1, U1], + u2: Shape2[? <: Level, M2, U2] ): Shape2[Level, (M1,M2), (U1,U2)] = ??? def foo: Unit = { class Coffees extends ColumnBase[Int] - def map1[F, T](f: F)(implicit shape: Shape2[_ <: Flat, F, T]) = ??? + def map1[F, T](f: F)(implicit shape: Shape2[? <: Flat, F, T]) = ??? map1(((1, null: Coffees), 1)) map1(((null: Coffees, 1), 1)) // fails with implicit divergence error in 2.11.0-M6, works under 2.10.3 diff --git a/tests/pos/t8128.scala b/tests/pos/t8128.scala index b6f76691b021..ce0826503341 100644 --- a/tests/pos/t8128.scala +++ b/tests/pos/t8128.scala @@ -1,9 +1,9 @@ object G { - def unapply(m: Any): Option[_] = Some("") + def unapply(m: Any): Option[?] = Some("") } object H { - def unapplySeq(m: Any): Option[Seq[_]] = None + def unapplySeq(m: Any): Option[Seq[?]] = None } object Test { diff --git a/tests/pos/t9004.scala b/tests/pos/t9004.scala index d591bc852a7b..bfbaee6fdad4 100644 --- a/tests/pos/t9004.scala +++ b/tests/pos/t9004.scala @@ -1,7 +1,7 @@ object Main { trait AA[RR] { type R = RR; def r: R } - def test1(a: AA[_]) = { + def test1(a: AA[?]) = { val f = () => a.r // The tree a.r is given the type `a.R` which normalizes // to B', where B' is a distinct symbol ("captured existential skolem") diff --git a/tests/pos/t9419.jackson.scala b/tests/pos/t9419.jackson.scala index bf26c7e4c672..5cdab09b04a0 100644 --- a/tests/pos/t9419.jackson.scala +++ b/tests/pos/t9419.jackson.scala @@ -7,14 +7,14 @@ import scala.language.implicitConversions trait EnrichedType[X]: def value: X -trait ClassW extends EnrichedType[Class[_]]: +trait ClassW extends EnrichedType[Class[?]]: def extendsScalaClass = false class Test: - implicit def mkClassW(c: => Class[_]): ClassW = new ClassW: + implicit def mkClassW(c: => Class[?]): ClassW = new ClassW: lazy val value = c - def test1(c1: Class[_]) = c1.extendsScalaClass // ok: c1 is a value - def test2(c2: Class[_]) = mkClassW(c2).extendsScalaClass // ok: c2 is a value + def test1(c1: Class[?]) = c1.extendsScalaClass // ok: c1 is a value + def test2(c2: Class[?]) = mkClassW(c2).extendsScalaClass // ok: c2 is a value // c1 in test1 goes throw adapting to find the extension method and gains the wildcard capture cast then // c2 in test2 goes straight to typedArg, as it's already an arg, so it never gets wildcard captured diff --git a/tests/pos/type-test-syntesize.scala b/tests/pos/type-test-syntesize.scala index de5540c6b0c1..98e201a03ef2 100644 --- a/tests/pos/type-test-syntesize.scala +++ b/tests/pos/type-test-syntesize.scala @@ -13,7 +13,7 @@ object Test { test[Any, Int] test[Any, String] - test[Any, Some[_]] + test[Any, Some[?]] test[Any, Array[Int]] test[Seq[Int], List[Int]] diff --git a/tests/pos/unapplyGeneric.scala b/tests/pos/unapplyGeneric.scala index 987efdd95691..a0523be18d61 100644 --- a/tests/pos/unapplyGeneric.scala +++ b/tests/pos/unapplyGeneric.scala @@ -3,7 +3,7 @@ object Bar { } class Bar[A,B](val _1:A, val _2:B) extends Product2[A,B] { - def canEqual(other: Any) = other.isInstanceOf[Bar[_,_]] + def canEqual(other: Any) = other.isInstanceOf[Bar[?,?]] } object Test { diff --git a/tests/pos/unchecked-a.scala b/tests/pos/unchecked-a.scala index deceb91c3662..5a53cb3977c8 100644 --- a/tests/pos/unchecked-a.scala +++ b/tests/pos/unchecked-a.scala @@ -3,10 +3,10 @@ trait Z extends Y class X[+A <: Y] object Test { - def f1(x: X[_ <: Y]) = x match { + def f1(x: X[? <: Y]) = x match { case _: X[Any] => // looks a little funny; `Any` is outside the bounds for `A` } - def f2(x: X[_ <: Y]) = x match { + def f2(x: X[? <: Y]) = x match { case _: X[Y] => // looks better, let's allow this (too) } diff --git a/tests/pos/virtpatmat_exist1.scala b/tests/pos/virtpatmat_exist1.scala index 93c37d76c422..03ad81d92c46 100644 --- a/tests/pos/virtpatmat_exist1.scala +++ b/tests/pos/virtpatmat_exist1.scala @@ -25,7 +25,7 @@ object Test { def splitArray[T](ad: Array[Iterable[T]]): Any = ad(0) match { - case _: HashMapCollision1[_, _] | _: HashSetCollision1[_] => null + case _: HashMapCollision1[?, ?] | _: HashSetCollision1[?] => null } // without type ascription for the one in the body of the last flatmap of each alternative, type inference borks on the existentials diff --git a/tests/pos/virtpatmat_exist2.scala b/tests/pos/virtpatmat_exist2.scala index c16c2721cc83..33873d68a4ee 100644 --- a/tests/pos/virtpatmat_exist2.scala +++ b/tests/pos/virtpatmat_exist2.scala @@ -1,9 +1,9 @@ class ParseResult[+T] -case class MemoEntry[+T](var r: Either[Nothing,ParseResult[_]]) +case class MemoEntry[+T](var r: Either[Nothing,ParseResult[?]]) object Test { def grow[T]: ParseResult[T] = (null: MemoEntry[T]) match { - case MemoEntry(Right(x: ParseResult[_])) => x.asInstanceOf[ParseResult[T]] + case MemoEntry(Right(x: ParseResult[?])) => x.asInstanceOf[ParseResult[T]] } // what's the _$1 doing there? diff --git a/tests/pos/virtpatmat_exist3.scala b/tests/pos/virtpatmat_exist3.scala index 6a6d428b1a09..c8a74802c5ba 100644 --- a/tests/pos/virtpatmat_exist3.scala +++ b/tests/pos/virtpatmat_exist3.scala @@ -1,5 +1,5 @@ class ReferenceQueue[T] { - def wrapper(jref: ReferenceQueue[_]): ReferenceQueue[T] = + def wrapper(jref: ReferenceQueue[?]): ReferenceQueue[T] = jref match { case null => null } diff --git a/tests/pos/virtpatmat_exist4.scala b/tests/pos/virtpatmat_exist4.scala index b81134b0457a..7003e572c416 100644 --- a/tests/pos/virtpatmat_exist4.scala +++ b/tests/pos/virtpatmat_exist4.scala @@ -27,7 +27,7 @@ object Test { } object Test2 { - type JClass = java.lang.Class[_] + type JClass = java.lang.Class[?] def tvarString(bounds: List[AnyRef]) = { bounds collect { case x: JClass => x } diff --git a/tests/pos/virtpatmat_exist_uncurry.scala b/tests/pos/virtpatmat_exist_uncurry.scala index 727922b31c0c..2f868ea006a9 100644 --- a/tests/pos/virtpatmat_exist_uncurry.scala +++ b/tests/pos/virtpatmat_exist_uncurry.scala @@ -1,6 +1,6 @@ object Test { trait Leaf[T] { - def collect[U](f: PartialFunction[Leaf[_], U]): List[U] + def collect[U](f: PartialFunction[Leaf[?], U]): List[U] def leaves: List[Leaf[T]] = collect { case l: Leaf[T] => l } } } diff --git a/tests/pos/widen-existential.scala b/tests/pos/widen-existential.scala index 7c10d60e1aaa..7b3ae512798b 100644 --- a/tests/pos/widen-existential.scala +++ b/tests/pos/widen-existential.scala @@ -1,7 +1,7 @@ class A { - { val x = classOf[List[_]] } + { val x = classOf[List[?]] } def f = { - val g = classOf[List[_]] + val g = classOf[List[?]] List(g, g) } } diff --git a/tests/pos/wildcardBoundInference.scala b/tests/pos/wildcardBoundInference.scala index 1cd3495d652f..9ef1e2740c59 100644 --- a/tests/pos/wildcardBoundInference.scala +++ b/tests/pos/wildcardBoundInference.scala @@ -7,7 +7,7 @@ public class Exist { } */ class Exist[T <: String] { - def foo: Exist[_] = null + def foo: Exist[?] = null } /* @@ -18,7 +18,7 @@ public class ExistF> { */ class ExistF[T <: ExistF[T]] { - def foo: ExistF[_] = null + def foo: ExistF[?] = null } /* @@ -29,15 +29,15 @@ public class ExistIndir { */ class ExistIndir[T <: String, U <: T] { - def foo: ExistIndir[_, _] = null + def foo: ExistIndir[?, ?] = null } class Test { class MyExist extends ExistF[MyExist] // SI-8197, SI-6169: java infers the bounds of existentials, so we have to as well now that SI-1786 is fixed... - def stringy: Exist[_ <: String] = (new Exist[String]).foo + def stringy: Exist[? <: String] = (new Exist[String]).foo // def fbounded: (ExistF[t] forSome {type t <: ExistF[t] }) = (new MyExist).foo - def indir: ExistIndir[_ <: String, _ <: String] = (new ExistIndir[String, String]).foo + def indir: ExistIndir[? <: String, ? <: String] = (new ExistIndir[String, String]).foo } @@ -51,7 +51,7 @@ public interface Skinnable { class OP[T] trait Skin[C <: Skinnable] trait Skinnable { - def skinProperty: OP[Skin[_]] + def skinProperty: OP[Skin[?]] } object ObjectProperty { implicit def jfxObjectProperty2sfx[T](p: OP[T]): ObjectProperty[T] = new ObjectProperty[T](p) @@ -61,9 +61,9 @@ class ObjectProperty[T](val deleg: OP[T]) trait TestWildcardBoundInference { def deleg: Skinnable - def skin: ObjectProperty[Skin[_ /* inferred: <: Skinnable */]] = ObjectProperty.jfxObjectProperty2sfx(deleg.skinProperty) - skin: ObjectProperty[Skin[_ <: Skinnable]] + def skin: ObjectProperty[Skin[? /* inferred: <: Skinnable */]] = ObjectProperty.jfxObjectProperty2sfx(deleg.skinProperty) + skin: ObjectProperty[Skin[? <: Skinnable]] def skinCheckInference = deleg.skinProperty - skinCheckInference: ObjectProperty[Skin[_ <: Skinnable]] + skinCheckInference: ObjectProperty[Skin[? <: Skinnable]] } diff --git a/tests/pos/wildcardInInfixType.scala b/tests/pos/wildcardInInfixType.scala index 9905762c50d9..b68aa5fb81c7 100644 --- a/tests/pos/wildcardInInfixType.scala +++ b/tests/pos/wildcardInInfixType.scala @@ -1,9 +1,9 @@ object wildcardInInfixType { - val useless: _ => _ = (x: Int) => 1 + val useless: ? => ? = (x: Int) => 1 - val pointless: (_ <: Int) => _ = (x: Int) => 1 + val pointless: (? <: Int) => ? = (x: Int) => 1 - val answer: Int Either _ = Left(42) + val answer: Int Either ? = Left(42) } diff --git a/tests/run-custom-args/captures/colltest5/CollectionStrawManCC5_1.scala b/tests/run-custom-args/captures/colltest5/CollectionStrawManCC5_1.scala index efd331604fbe..667b4deb851a 100644 --- a/tests/run-custom-args/captures/colltest5/CollectionStrawManCC5_1.scala +++ b/tests/run-custom-args/captures/colltest5/CollectionStrawManCC5_1.scala @@ -484,7 +484,7 @@ object CollectionStrawMan5 { this: Concat[A]^{underlying, other} => def iterator: Iterator[A]^{this} = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -495,7 +495,7 @@ object CollectionStrawMan5 { this: Zip[A, B]^{underlying, other} => def iterator: Iterator[(A, B)]^{this} = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala b/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala index 7f723ba86806..406406ff2b5b 100644 --- a/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala +++ b/tests/run-deep-subtype/colltest4/CollectionStrawMan4_1.scala @@ -414,7 +414,7 @@ object CollectionStrawMan4 { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -423,7 +423,7 @@ object CollectionStrawMan4 { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/run-macros/flops-rewrite-2/Macro_1.scala b/tests/run-macros/flops-rewrite-2/Macro_1.scala index b408854669b9..f3713d4176b7 100644 --- a/tests/run-macros/flops-rewrite-2/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-2/Macro_1.scala @@ -59,11 +59,11 @@ class Transformation[T: Type](transform: PartialFunction[Expr[T], Expr[T]]) { } private object Rewriter { - def apply(preTransform: List[Transformation[_]] = Nil, postTransform: List[Transformation[_]] = Nil, fixPoint: Boolean = false): Rewriter = + def apply(preTransform: List[Transformation[?]] = Nil, postTransform: List[Transformation[?]] = Nil, fixPoint: Boolean = false): Rewriter = new Rewriter(preTransform, postTransform, fixPoint) } -private class Rewriter(preTransform: List[Transformation[_]] = Nil, postTransform: List[Transformation[_]] = Nil, fixPoint: Boolean) extends ExprMap { +private class Rewriter(preTransform: List[Transformation[?]] = Nil, postTransform: List[Transformation[?]] = Nil, fixPoint: Boolean) extends ExprMap { def transform[T](e: Expr[T])(using Type[T])(using Quotes): Expr[T] = { val e2 = preTransform.foldLeft(e)((ei, transform) => transform(ei)) val e3 = transformChildren(e2) diff --git a/tests/run-macros/i7887/Macro_1.scala b/tests/run-macros/i7887/Macro_1.scala index 9ba02c41ab23..2c3c72461604 100644 --- a/tests/run-macros/i7887/Macro_1.scala +++ b/tests/run-macros/i7887/Macro_1.scala @@ -1,4 +1,4 @@ -def myMacroImpl(a: quoted.Expr[_])(using qctx: quoted.Quotes) = { +def myMacroImpl(a: quoted.Expr[?])(using qctx: quoted.Quotes) = { import scala.quoted.quotes.reflect.* def typed[A] = { implicit val t: quoted.Type[A] = a.asTerm.tpe.widen.asType.asInstanceOf[quoted.Type[A]] diff --git a/tests/run-macros/i7898/Macro_1.scala b/tests/run-macros/i7898/Macro_1.scala index 9a87787b895e..932cc2e34f3c 100644 --- a/tests/run-macros/i7898/Macro_1.scala +++ b/tests/run-macros/i7898/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted.* object Main { - def myMacroImpl(body: Expr[_])(using Quotes) : Expr[_] = { + def myMacroImpl(body: Expr[?])(using Quotes) : Expr[?] = { import quotes.reflect.* val bodyTerm = underlyingArgument(body).asTerm val showed = bodyTerm.show diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index 7f429708c233..c36b4f68d0f8 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -25,7 +25,7 @@ object Eq { def eqv(x: T, y: T): Boolean = body(x, y) } - def summonAll[T: Type](using Quotes): List[Expr[Eq[_]]] = Type.of[T] match { + def summonAll[T: Type](using Quotes): List[Expr[Eq[?]]] = Type.of[T] match { case '[String *: tpes] => '{ summon[Eq[String]] } :: summonAll[tpes] case '[Int *: tpes] => '{ summon[Eq[Int]] } :: summonAll[tpes] case '[tpe *: tpes] => derived[tpe] :: summonAll[tpes] diff --git a/tests/run-macros/no-symbol/2.scala b/tests/run-macros/no-symbol/2.scala index cb85878e7bd9..c1812024eabf 100644 --- a/tests/run-macros/no-symbol/2.scala +++ b/tests/run-macros/no-symbol/2.scala @@ -1,6 +1,6 @@ object Test { def main(args: Array[String]): Unit = { assert(Macro.foo[Foo] == "symbol") - assert(Macro.foo[Box[_]] == "no symbol") + assert(Macro.foo[Box[?]] == "no symbol") } } diff --git a/tests/run-macros/quote-matcher-runtime/quoted_1.scala b/tests/run-macros/quote-matcher-runtime/quoted_1.scala index 1f7646320747..0a2c06ef770c 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_1.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_1.scala @@ -9,9 +9,9 @@ object Macros { val res = quotes.asInstanceOf[scala.quoted.runtime.QuoteMatching].ExprMatch.unapply[Tuple, Tuple](a)(using b).map { tup => tup.toArray.toList.map { - case r: Expr[_] => + case r: Expr[?] => s"Expr(${r.show})" - case t: Type[_] => + case t: Type[?] => s"Type(${Type.show(using t)})" } } diff --git a/tests/run-macros/quote-type-matcher/quoted_1.scala b/tests/run-macros/quote-type-matcher/quoted_1.scala index 346c73daeed2..ed00e4923c40 100644 --- a/tests/run-macros/quote-type-matcher/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher/quoted_1.scala @@ -9,7 +9,7 @@ object Macros { val res = quotes.asInstanceOf[scala.quoted.runtime.QuoteMatching].TypeMatch.unapply[Tuple, Tuple](a)(using b).map { tup => tup.toArray.toList.map { - case r: Type[_] => + case r: Type[?] => s"Type(${TypeTree.of(using r).show})" } } diff --git a/tests/run-macros/quoted-ToExpr-derivation-macro/Derivation_1.scala b/tests/run-macros/quoted-ToExpr-derivation-macro/Derivation_1.scala index 7ac7a341d6b1..4a402ca3727d 100644 --- a/tests/run-macros/quoted-ToExpr-derivation-macro/Derivation_1.scala +++ b/tests/run-macros/quoted-ToExpr-derivation-macro/Derivation_1.scala @@ -22,7 +22,7 @@ object ToExprMaker { // TODO hide from users class SumToExpr[T, MElemTypes]( mirror: Mirror.Sum { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Int => ToExpr[_] + liftables: Int => ToExpr[?] )(using Type[T]) extends ToExpr[T]: def apply(x: T)(using Quotes): Expr[T] = val ordinal = mirror.ordinal(x) @@ -33,7 +33,7 @@ object ToExprMaker { // TODO hide from users class ProductToExpr[T, MElemTypes]( mirror: Mirror.Product { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Seq[ToExpr[_]] + liftables: Seq[ToExpr[?]] )(using Type[T]) extends ToExpr[T]: def apply(x: T)(using Quotes): Expr[T] = val mirrorExpr = summonExprOrError[Mirror.ProductOf[T]] @@ -47,12 +47,12 @@ object ToExprMaker { '{ $mirrorExpr.fromProduct($elemsTupleExpr) } end ProductToExpr - private def elemTypesToExprs[X: Type](using Quotes): List[Expr[ToExpr[_]]] = + private def elemTypesToExprs[X: Type](using Quotes): List[Expr[ToExpr[?]]] = Type.of[X] match case '[ head *: tail ] => summonExprOrError[ToExpr[head]] :: elemTypesToExprs[tail] case '[ EmptyTuple ] => Nil - private def elemType[X: Type](ordinal: Int)(using Quotes): Type[_] = + private def elemType[X: Type](ordinal: Int)(using Quotes): Type[?] = Type.of[X] match case '[ head *: tail ] => if ordinal == 0 then Type.of[head] @@ -64,11 +64,11 @@ object ToExprMaker { case None => quotes.reflect.report.errorAndAbort(s"Could not find implicit ${Type.show[T]}") - private def switchExpr(scrutinee: Expr[Int], seq: List[Expr[ToExpr[_]]])(using Quotes): Expr[ToExpr[_]] = + private def switchExpr(scrutinee: Expr[Int], seq: List[Expr[ToExpr[?]]])(using Quotes): Expr[ToExpr[?]] = import quotes.reflect._ val cases = seq.zipWithIndex.map { (expr, i) => CaseDef(Literal(IntConstant(i)), None, expr.asTerm) } - Match(scrutinee.asTerm, cases).asExprOf[ToExpr[_]] + Match(scrutinee.asTerm, cases).asExprOf[ToExpr[?]] } diff --git a/tests/run-macros/quoted-liftable-derivation-macro-2/Derivation_1.scala b/tests/run-macros/quoted-liftable-derivation-macro-2/Derivation_1.scala index 1b45835006c0..2fa495fd74ee 100644 --- a/tests/run-macros/quoted-liftable-derivation-macro-2/Derivation_1.scala +++ b/tests/run-macros/quoted-liftable-derivation-macro-2/Derivation_1.scala @@ -26,7 +26,7 @@ object Lft { class LiftableSum[T, MElemTypes]( mirror: Mirror.Sum { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Int => Lft[_] + liftables: Int => Lft[?] )(using Type[T]) extends Lft[T]: def toExpr(x: T)(using Quotes): Expr[T] = val ordinal = mirror.ordinal(x) @@ -36,7 +36,7 @@ object Lft { class LiftableProduct[T, MElemTypes]( mirror: Mirror.Product { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Seq[Lft[_]] + liftables: Seq[Lft[?]] )(using Type[T]) extends Lft[T]: def toExpr(x: T)(using Quotes): Expr[T] = val mirrorExpr = summonExprOrError[Mirror.ProductOf[T]] @@ -50,12 +50,12 @@ object Lft { '{ $mirrorExpr.fromProduct($elemsTupleExpr) } end LiftableProduct - private def elemTypesLfts[X: Type](using Quotes): List[Expr[Lft[_]]] = + private def elemTypesLfts[X: Type](using Quotes): List[Expr[Lft[?]]] = Type.of[X] match case '[ head *: tail ] => summonExprOrError[Lft[head]] :: elemTypesLfts[tail] case '[ EmptyTuple ] => Nil - private def elemType[X: Type](ordinal: Int)(using Quotes): Type[_] = + private def elemType[X: Type](ordinal: Int)(using Quotes): Type[?] = Type.of[X] match case '[ head *: tail ] => if ordinal == 0 then Type.of[head] @@ -67,11 +67,11 @@ object Lft { case None => quotes.reflect.report.errorAndAbort(s"Could not find implicit ${Type.show[T]}") - private def switchExpr(scrutinee: Expr[Int], seq: List[Expr[Lft[_]]])(using Quotes): Expr[Lft[_]] = + private def switchExpr(scrutinee: Expr[Int], seq: List[Expr[Lft[?]]])(using Quotes): Expr[Lft[?]] = import quotes.reflect._ val cases = seq.zipWithIndex.map { (expr, i) => CaseDef(Literal(IntConstant(i)), None, expr.asTerm) } - Match(scrutinee.asTerm, cases).asExprOf[Lft[_]] + Match(scrutinee.asTerm, cases).asExprOf[Lft[?]] } diff --git a/tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala b/tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala index 8ecde7988f4e..c4f926767052 100644 --- a/tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala +++ b/tests/run-macros/quoted-liftable-derivation-macro/Derivation_1.scala @@ -24,7 +24,7 @@ object Lft { class LiftableSum[T, MElemTypes]( mirror: Mirror.Sum { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Seq[Lft[_]] // TODO make Lft creation lazy + liftables: Seq[Lft[?]] // TODO make Lft creation lazy ) extends Lft[T]: def toExpr(x: T)(using Type[T], Quotes): Expr[T] = val ordinal = mirror.ordinal(x) @@ -37,7 +37,7 @@ object Lft { class LiftableProduct[T, MElemTypes]( mirror: Mirror.Product { type MirroredElemTypes = MElemTypes; type MirroredMonoType = T }, - liftables: Seq[Lft[_]] + liftables: Seq[Lft[?]] ) extends Lft[T]: def toExpr(x: T)(using Type[T], Quotes): Expr[T] = val mirrorExpr = Expr.summon[Mirror.ProductOf[T]].get @@ -49,13 +49,13 @@ object Lft { '{ $mirrorExpr.fromProduct($elemsTupleExpr) } end LiftableProduct - private def elemTypesLfts[X: Type](using Quotes): List[Expr[Lft[_]]] = + private def elemTypesLfts[X: Type](using Quotes): List[Expr[Lft[?]]] = Type.of[X] match case '[ head *: tail ] => Expr.summon[Lft[head]].getOrElse(quotes.reflect.report.errorAndAbort(s"Could not find given Lft[${Type.show[head]}]")) :: elemTypesLfts[tail] case '[ EmptyTuple ] => Nil - private def elemType[X: Type](ordinal: Int)(using Quotes): Type[_] = + private def elemType[X: Type](ordinal: Int)(using Quotes): Type[?] = Type.of[X] match case '[ head *: tail ] => if ordinal == 0 then Type.of[head] diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index f16c5ddd8134..578a3ff6c497 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -16,7 +16,7 @@ object Test { '{ // class Object - ${test(classOf[Array[_]])} + ${test(classOf[Array[?]])} // class Array[Foo] ${test(classOf[Array[Foo]])} diff --git a/tests/run-staging/i5161b.scala b/tests/run-staging/i5161b.scala index 2c6f0c3474d0..fced662a9411 100644 --- a/tests/run-staging/i5161b.scala +++ b/tests/run-staging/i5161b.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = { def res(using Quotes) = '{ val x: Option[Int] = Option(3) - if (x.isInstanceOf[Some[_]]) Option(1) + if (x.isInstanceOf[Some[?]]) Option(1) else None } println("show0 : " + withQuotes(res.show)) diff --git a/tests/run-staging/quote-function-applied-to.scala b/tests/run-staging/quote-function-applied-to.scala index 454b8bb6e1a8..7a35f0fab59d 100644 --- a/tests/run-staging/quote-function-applied-to.scala +++ b/tests/run-staging/quote-function-applied-to.scala @@ -4,7 +4,7 @@ import scala.quoted.staging.* object Test { def main(args: Array[String]): Unit = { given Compiler = Compiler.make(getClass.getClassLoader) - def show(expr: Quotes ?=> Expr[_]): String = withQuotes(expr.show) + def show(expr: Quotes ?=> Expr[?]): String = withQuotes(expr.show) println(show(Expr.betaReduce('{ (() => x(0))() }))) println(show(Expr.betaReduce('{ ((x1: Int) => x1)(x(1)) }))) println(show(Expr.betaReduce('{ ((x1: Int, x2: Int) => x1 + x2)(x(1), x(2)) }))) diff --git a/tests/run-staging/quote-lift-Array.scala b/tests/run-staging/quote-lift-Array.scala index b65695097f11..8bd3edce2667 100644 --- a/tests/run-staging/quote-lift-Array.scala +++ b/tests/run-staging/quote-lift-Array.scala @@ -5,7 +5,7 @@ object Test { def main(args: Array[String]): Unit = run { '{ def p[T](arr: Array[T]): Unit = { - println(arr.asInstanceOf[Array[_]].mkString("[", ", ", "]")) + println(arr.asInstanceOf[Array[?]].mkString("[", ", ", "]")) } p(${Expr(Array.empty[Boolean])}) p(${Expr(Array.empty[Byte])}) diff --git a/tests/run-staging/quote-lift-IArray.scala b/tests/run-staging/quote-lift-IArray.scala index 8219ce96f063..636e0b323fe5 100644 --- a/tests/run-staging/quote-lift-IArray.scala +++ b/tests/run-staging/quote-lift-IArray.scala @@ -6,7 +6,7 @@ object Test { def main(args: Array[String]): Unit = run { '{ def p[T](arr: IArray[T]): Unit = { - println(arr.asInstanceOf[Array[_]].mkString("[", ", ", "]")) + println(arr.asInstanceOf[Array[?]].mkString("[", ", ", "]")) } p(${Expr(IArray.empty[Boolean])}) p(${Expr(IArray.empty[Byte])}) diff --git a/tests/run-staging/shonan-hmm/UnrolledExpr.scala b/tests/run-staging/shonan-hmm/UnrolledExpr.scala index f73b446aed93..b2c130934e15 100644 --- a/tests/run-staging/shonan-hmm/UnrolledExpr.scala +++ b/tests/run-staging/shonan-hmm/UnrolledExpr.scala @@ -8,8 +8,8 @@ object UnrolledExpr { } // TODO support blocks in the compiler to avoid creating trees of blocks? - def block[T: Type](stats: Iterable[Expr[_]], expr: Expr[T])(using Quotes): Expr[T] = { - def rec(stats: List[Expr[_]]): Expr[T] = stats match { + def block[T: Type](stats: Iterable[Expr[?]], expr: Expr[T])(using Quotes): Expr[T] = { + def rec(stats: List[Expr[?]]): Expr[T] = stats match { case x :: xs => '{ $x; ${rec(xs)} } case Nil => expr } diff --git a/tests/run-staging/staged-tuples/StagedTuple.scala b/tests/run-staging/staged-tuples/StagedTuple.scala index bbc6471172aa..ee9714eefbe0 100644 --- a/tests/run-staging/staged-tuples/StagedTuple.scala +++ b/tests/run-staging/staged-tuples/StagedTuple.scala @@ -84,13 +84,13 @@ object StagedTuple { else { val resVal = size match { case Some(1) => - '{${ tup.as[Tuple1[_]] }._1} + '{${ tup.as[Tuple1[?]] }._1} case Some(2) => - '{${ tup.as[Tuple2[_, _]] }._1} + '{${ tup.as[Tuple2[?, ?]] }._1} case Some(3) => - '{${ tup.as[Tuple3[_, _, _]]}._1} + '{${ tup.as[Tuple3[?, ?, ?]]}._1} case Some(4) => - '{${ tup.as[Tuple4[_, _, _, _]] }._1} + '{${ tup.as[Tuple4[?, ?, ?, ?]] }._1} case Some(n) if n > 4 && n <= MaxSpecialized => '{${ tup.as[Product] }.productElement(0)} case Some(n) if n > MaxSpecialized => @@ -109,13 +109,13 @@ object StagedTuple { case Some(1) => '{Tuple()} case Some(2) => - tup.as[Tuple2[_, _]].bind(t => '{Tuple1($t._2)}) + tup.as[Tuple2[?, ?]].bind(t => '{Tuple1($t._2)}) case Some(3) => - tup.as[Tuple3[_, _, _]].bind(t => '{Tuple2($t._2, $t._3)}) + tup.as[Tuple3[?, ?, ?]].bind(t => '{Tuple2($t._2, $t._3)}) case Some(4) => - tup.as[Tuple4[_, _, _, _]].bind(t => '{Tuple3($t._2, $t._3, $t._4)}) + tup.as[Tuple4[?, ?, ?, ?]].bind(t => '{Tuple3($t._2, $t._3, $t._4)}) case Some(5) => - tup.as[Tuple5[_, _, _, _, _]].bind(t => '{Tuple4($t._2, $t._3, $t._4, $t._5)}) + tup.as[Tuple5[?, ?, ?, ?, ?]].bind(t => '{Tuple4($t._2, $t._3, $t._4, $t._5)}) case Some(n) if n > 5 => val arr = toArrayStaged(tup, size) fromArrayStaged[Tail[Tup]]('{ $arr.tail }, Some(n - 1)) @@ -138,20 +138,20 @@ object StagedTuple { } val res = size match { case Some(1) => - val t = tup.as[Tuple1[_]] + val t = tup.as[Tuple1[?]] nValue match { case Some(0) => '{$t._1} case _ => fallbackApply() } case Some(2) => - val t = tup.as[Tuple2[_, _]] + val t = tup.as[Tuple2[?, ?]] nValue match { case Some(0) => '{$t._1} case Some(1) => '{$t._2} case _ => fallbackApply() } case Some(3) => - val t = tup.as[Tuple3[_, _, _]] + val t = tup.as[Tuple3[?, ?, ?]] nValue match { case Some(0) => '{$t._1} case Some(1) => '{$t._2} @@ -159,7 +159,7 @@ object StagedTuple { case _ => fallbackApply() } case Some(4) => - val t = tup.as[Tuple4[_, _, _, _]] + val t = tup.as[Tuple4[?, ?, ?, ?]] nValue match { case Some(0) => '{$t._1} case Some(1) => '{$t._2} @@ -192,13 +192,13 @@ object StagedTuple { case Some(0) => '{Tuple1($x)} case Some(1) => - self.as[Tuple1[_]].bind(t => '{Tuple2($x, $t._1)}) + self.as[Tuple1[?]].bind(t => '{Tuple2($x, $t._1)}) case Some(2) => - self.as[Tuple2[_, _]].bind(t => '{Tuple3($x, $t._1, $t._2)}) + self.as[Tuple2[?, ?]].bind(t => '{Tuple3($x, $t._1, $t._2)}) case Some(3) => - self.as[Tuple3[_, _, _]].bind(t => '{Tuple4($x, $t._1, $t._2, $t._3)}) + self.as[Tuple3[?, ?, ?]].bind(t => '{Tuple4($x, $t._1, $t._2, $t._3)}) case Some(4) => - self.as[Tuple4[_, _, _, _]].bind(t => '{Tuple5($x, $t._1, $t._2, $t._3, $t._4)}) + self.as[Tuple4[?, ?, ?, ?]].bind(t => '{Tuple5($x, $t._1, $t._2, $t._3, $t._4)}) case _ => '{scala.runtime.Tuples.cons($x, $self)} } @@ -217,29 +217,29 @@ object StagedTuple { that case Some(1) => if (thatSize.contains(0)) self - else consStaged(that, '{$self.asInstanceOf[Tuple1[_]]._1}, thatSize) + else consStaged(that, '{$self.asInstanceOf[Tuple1[?]]._1}, thatSize) case Some(2) => - val self2 = self.as[Tuple2[_, _]] + val self2 = self.as[Tuple2[?, ?]] thatSize match { case Some(0) => self case Some(1) => self2.bind { t => - that.as[Tuple1[_]].bind(u => '{Tuple3($t._1, $t._2, $u._1)}) + that.as[Tuple1[?]].bind(u => '{Tuple3($t._1, $t._2, $u._1)}) } case Some(2) => self2.bind { t => - that.as[Tuple2[_, _]].bind(u => '{Tuple4($t._1, $t._2, $u._1, $u._2)}) + that.as[Tuple2[?, ?]].bind(u => '{Tuple4($t._1, $t._2, $u._1, $u._2)}) } case _ => genericConcat(self, that) } case Some(3) => - val self2 = self.as[Tuple3[_, _, _]] + val self2 = self.as[Tuple3[?, ?, ?]] thatSize match { case Some(0) => self case Some(1) => self2.bind { t => - that.as[Tuple1[_]].bind(u => '{Tuple4($t._1, $t._2, $t._3, $u._1)}) + that.as[Tuple1[?]].bind(u => '{Tuple4($t._1, $t._2, $t._3, $u._1)}) } case _ => genericConcat(self, that) diff --git a/tests/run/16405.scala b/tests/run/16405.scala index fa0681683c42..e717cbbd2f72 100644 --- a/tests/run/16405.scala +++ b/tests/run/16405.scala @@ -9,7 +9,7 @@ object TypeDesc { def exampleFn(s: String, i: Int): Unit = () -inline def argumentTypesOf[R](fun: (_, _) => R): (TypeDesc[?], TypeDesc[?]) = { +inline def argumentTypesOf[R](fun: (?, ?) => R): (TypeDesc[?], TypeDesc[?]) = { inline fun match { case x: ((a, b) => R) => (scala.compiletime.summonInline[TypeDesc[a]], scala.compiletime.summonInline[TypeDesc[b]]) diff --git a/tests/run/CollectionTests.scala b/tests/run/CollectionTests.scala index 6ecc30f78aef..61cb8dba9010 100644 --- a/tests/run/CollectionTests.scala +++ b/tests/run/CollectionTests.scala @@ -405,7 +405,7 @@ object CollectionStrawMan5 { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -414,7 +414,7 @@ object CollectionStrawMan5 { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/run/Parser.scala b/tests/run/Parser.scala index 48c3af73ecec..ab6eadc2880e 100644 --- a/tests/run/Parser.scala +++ b/tests/run/Parser.scala @@ -22,7 +22,7 @@ class ParserOps[T](p: Parser[T]): ) def | [U](q: => into Parser[T]): Parser[T] = Parser(in => p.parse(in) match - case s: Success[_] => s + case s: Success[?] => s case fail: Failure => q.parse(in) ) def map[U](f: T => U): Parser[U] = Parser(in => diff --git a/tests/run/Typeable.scala b/tests/run/Typeable.scala index 18bf9a4deb6a..593a547e796b 100644 --- a/tests/run/Typeable.scala +++ b/tests/run/Typeable.scala @@ -35,7 +35,7 @@ object Typeable: given list[T: Typeable]: Typeable[List[T]] with def cast(x: Any): Option[List[T]] = x match - case x: List[_] if x.forall(Typeable[T].cast(_).isDefined) => Some(x.asInstanceOf[List[T]]) + case x: List[?] if x.forall(Typeable[T].cast(_).isDefined) => Some(x.asInstanceOf[List[T]]) case _ => None def describe = s"List[${Typeable[T].describe}]" end Typeable diff --git a/tests/run/array-addition.scala b/tests/run/array-addition.scala index 09a1b0badace..835aff70f504 100644 --- a/tests/run/array-addition.scala +++ b/tests/run/array-addition.scala @@ -1,5 +1,5 @@ object Test { - def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")") + def prettyPrintArray(x: Array[?]) = println("Array(" + x.mkString(", ") + ")") def main(args: Array[String]): Unit = { prettyPrintArray(Array(1,2,3) :+ 4) diff --git a/tests/run/array-erasure.scala b/tests/run/array-erasure.scala index 1ce727337a4f..d9b96c941e38 100644 --- a/tests/run/array-erasure.scala +++ b/tests/run/array-erasure.scala @@ -14,7 +14,7 @@ object Test { assert(x(0) == 1) x.sameElements(x) x match { - case x: Array[_] => + case x: Array[?] => x(0) = 2 x.sameElements(x) } @@ -23,7 +23,7 @@ object Test { def arr2[T](x: T) = { x match { - case x: Array[_] => + case x: Array[?] => assert(x(0) == 2) x.sameElements(x) } diff --git a/tests/run/array-existential-bound.scala b/tests/run/array-existential-bound.scala index cc105d8fcdd2..2c819ee463fc 100644 --- a/tests/run/array-existential-bound.scala +++ b/tests/run/array-existential-bound.scala @@ -1,4 +1,4 @@ -trait Fooz[Q <: Array[_]] { +trait Fooz[Q <: Array[?]] { def f0(x: Q) = x.length } @@ -6,7 +6,7 @@ object Test extends Fooz[Array[Int]] { val f1 = new Fooz[Array[String]] { } val f2 = new Fooz[Array[Int]] { } val f3 = new Fooz[Array[Any]] { } - val f4 = new Fooz[Array[_]] { } + val f4 = new Fooz[Array[?]] { } def main(args: Array[String]): Unit = { println(f1.f0(Array[String]("a", "b"))) diff --git a/tests/run/colltest5/CollectionStrawMan5_1.scala b/tests/run/colltest5/CollectionStrawMan5_1.scala index e480b7e8c088..c91ce10cf991 100644 --- a/tests/run/colltest5/CollectionStrawMan5_1.scala +++ b/tests/run/colltest5/CollectionStrawMan5_1.scala @@ -398,7 +398,7 @@ object CollectionStrawMan5 { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength + other.knownLength case _ => -1 @@ -407,7 +407,7 @@ object CollectionStrawMan5 { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownLength = other match { - case other: Iterable[_] if underlying.knownLength >= 0 && other.knownLength >= 0 => + case other: Iterable[?] if underlying.knownLength >= 0 && other.knownLength >= 0 => underlying.knownLength min other.knownLength case _ => -1 diff --git a/tests/run/colltest6/CollectionStrawMan6_1.scala b/tests/run/colltest6/CollectionStrawMan6_1.scala index bed5c476b96d..c3eda3d3e649 100644 --- a/tests/run/colltest6/CollectionStrawMan6_1.scala +++ b/tests/run/colltest6/CollectionStrawMan6_1.scala @@ -866,7 +866,7 @@ object CollectionStrawMan6 extends LowPriority { case class Concat[A](underlying: Iterable[A], other: IterableOnce[A]) extends View[A] { def iterator = underlying.iterator ++ other override def knownSize = other match { - case other: Iterable[_] if underlying.knownSize >= 0 && other.knownSize >= 0 => + case other: Iterable[?] if underlying.knownSize >= 0 && other.knownSize >= 0 => underlying.knownSize + other.knownSize case _ => -1 @@ -879,7 +879,7 @@ object CollectionStrawMan6 extends LowPriority { case class Zip[A, B](underlying: Iterable[A], other: IterableOnce[B]) extends View[(A, B)] { def iterator = underlying.iterator.zip(other) override def knownSize = other match { - case other: Iterable[_] if underlying.knownSize >= 0 && other.knownSize >= 0 => + case other: Iterable[?] if underlying.knownSize >= 0 && other.knownSize >= 0 => underlying.knownSize min other.knownSize case _ => -1 diff --git a/tests/run/curried-mirror.scala b/tests/run/curried-mirror.scala index 84c544c7318b..526e253489cd 100644 --- a/tests/run/curried-mirror.scala +++ b/tests/run/curried-mirror.scala @@ -22,7 +22,7 @@ object Test extends App { { val v0 = summon[Mirror.Product { type MirroredType = [T, U] =>> Prod1[U] }] val v1 = v0.fromProduct(Tuple1(13)) - val v2: Prod1[_] = v1 + val v2: Prod1[?] = v1 assert(v2 == Prod1(13)) } @@ -31,14 +31,14 @@ object Test extends App { { val v0 = summon[Mirror.Product { type MirroredType[X, Y] = Prod2[X, Y] }] val v1 = v0.fromProduct((23, "foo")) - val v2: Prod2[_, _] = v1 + val v2: Prod2[?, ?] = v1 assert(v2 == Prod2(23, "foo")) } { val v0 = summon[Mirror.Product { type MirroredType = [B] =>> Prod2[Int, B] }] val v1 = v0.fromProduct((23, "foo")) - val v2: Prod2[Int, _] = v1 + val v2: Prod2[Int, ?] = v1 assert(v2 == Prod2(23, "foo")) } @@ -54,7 +54,7 @@ object Test extends App { { val v0 = summon[Mirror.Product { type MirroredType = [T, U] =>> ProdV1[U] }] val v1 = v0.fromProduct(Tuple1(13)) - val v2: ProdV1[_] = v1 + val v2: ProdV1[?] = v1 assert(v2 == ProdV1(13)) } @@ -63,14 +63,14 @@ object Test extends App { { val v0 = summon[Mirror.Product { type MirroredType[+X, +Y] = ProdV2[X, Y] }] val v1 = v0.fromProduct((23, "foo")) - val v2: ProdV2[_, _] = v1 + val v2: ProdV2[?, ?] = v1 assert(v2 == ProdV2(23, "foo")) } { val v0 = summon[Mirror.Product { type MirroredType = [B] =>> ProdV2[Int, B] }] val v1 = v0.fromProduct((23, "foo")) - val v2: ProdV2[Int, _] = v1 + val v2: ProdV2[Int, ?] = v1 assert(v2 == ProdV2(23, "foo")) } diff --git a/tests/run/decorators/sample-adapters.scala b/tests/run/decorators/sample-adapters.scala index 580a961b034f..2bc985c09a8f 100644 --- a/tests/run/decorators/sample-adapters.scala +++ b/tests/run/decorators/sample-adapters.scala @@ -7,8 +7,8 @@ class logged extends EntryPoint.Adapter: class LoggedWrapper(val wrapped: EntryPoint.Wrapper) extends Wrapper: def adapt[A, R](op: A => R)(args: A): R = val argsString: String = args match - case args: Array[_] => args.mkString(", ") - case args: Seq[_] => args.mkString(", ") + case args: Array[?] => args.mkString(", ") + case args: Seq[?] => args.mkString(", ") case args: Unit => "()" case args => args.toString val result = op(args) diff --git a/tests/run/enrich-gentraversable.scala b/tests/run/enrich-gentraversable.scala index 43514e5a5136..8d0e9d8dfae7 100644 --- a/tests/run/enrich-gentraversable.scala +++ b/tests/run/enrich-gentraversable.scala @@ -8,7 +8,7 @@ object Test extends App { def typed[T](t : => T): Unit = {} def testIterableOps = { - class FilterMapImpl[A, Repr](r: Repr, it: IterableOps[A, Iterable, _]) { + class FilterMapImpl[A, Repr](r: Repr, it: IterableOps[A, Iterable, ?]) { final def filterMap[B, That](f: A => Option[B])(implicit bf: BuildFrom[Repr, B, That]): That = bf.fromSpecific(r)(it.flatMap(f(_))) } diff --git a/tests/run/enum-constrs.scala b/tests/run/enum-constrs.scala index 1418f39b99b2..8b50a7ef4199 100644 --- a/tests/run/enum-constrs.scala +++ b/tests/run/enum-constrs.scala @@ -2,7 +2,7 @@ enum Color extends java.lang.Enum[Color] { case Red, Green, Blue } -enum E[+T] extends java.lang.Enum[E[_]] { +enum E[+T] extends java.lang.Enum[E[?]] { case S1, S2 case C extends E[Int] } diff --git a/tests/run/enum-custom-toString.scala b/tests/run/enum-custom-toString.scala index 7432bde87ff9..c19a0aceee0f 100644 --- a/tests/run/enum-custom-toString.scala +++ b/tests/run/enum-custom-toString.scala @@ -13,7 +13,7 @@ trait Mixin extends reflect.Enum: enum EM extends Mixin: case C -enum ET[T] extends java.lang.Enum[ET[_]]: +enum ET[T] extends java.lang.Enum[ET[?]]: case D extends ET[Unit] override def toString: String = "overridden" diff --git a/tests/run/enum-nat.scala b/tests/run/enum-nat.scala index dde0208ccf7d..e067656427b7 100644 --- a/tests/run/enum-nat.scala +++ b/tests/run/enum-nat.scala @@ -7,7 +7,7 @@ enum Nat: case Succ[N <: Nat.Refract](n: N) object Nat: - type Refract = Zero.type | Succ[_] + type Refract = Zero.type | Succ[?] inline def toIntTypeLevel[N <: Nat]: Int = inline erasedValue[N] match case _: Zero.type => 0 diff --git a/tests/run/enum-values-order.scala b/tests/run/enum-values-order.scala index dfe9c0d8f685..5a5bfce7e772 100644 --- a/tests/run/enum-values-order.scala +++ b/tests/run/enum-values-order.scala @@ -3,7 +3,7 @@ enum LatinAlphabet { case A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, enum LatinAlphabet2 extends java.lang.Enum[LatinAlphabet2] { case A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z } -enum LatinAlphabet3[+T] extends java.lang.Enum[LatinAlphabet3[_]] { case A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z } +enum LatinAlphabet3[+T] extends java.lang.Enum[LatinAlphabet3[?]] { case A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z } object Color: trait Pretty diff --git a/tests/run/erased-frameless.scala b/tests/run/erased-frameless.scala index fe654639492a..8ba05ba1b44b 100644 --- a/tests/run/erased-frameless.scala +++ b/tests/run/erased-frameless.scala @@ -41,10 +41,10 @@ class SelectedDataset[T, A](ds: Dataset[T], val col: Column[T, A]) extends Datas case SeqDataset(data) => println(s"selecting `${col.label}` from $data") col.label match { - case "a" => data.map(_.asInstanceOf[X4[A,_,_,_]].a).toVector - case "b" => data.map(_.asInstanceOf[X4[_,A,_,_]].b).toVector - case "c" => data.map(_.asInstanceOf[X4[_,_,A,_]].c).toVector - case "d" => data.map(_.asInstanceOf[X4[_,_,_,A]].d).toVector + case "a" => data.map(_.asInstanceOf[X4[A,?,?,?]].a).toVector + case "b" => data.map(_.asInstanceOf[X4[?,A,?,?]].b).toVector + case "c" => data.map(_.asInstanceOf[X4[?,?,A,?]].c).toVector + case "d" => data.map(_.asInstanceOf[X4[?,?,?,A]].d).toVector } } } diff --git a/tests/run/errorhandling/Result.scala b/tests/run/errorhandling/Result.scala index 07d7a9f90c8a..35f42047d0e3 100644 --- a/tests/run/errorhandling/Result.scala +++ b/tests/run/errorhandling/Result.scala @@ -10,23 +10,23 @@ object Result: /** `_.?` propagates Err to current Label */ transparent inline def ? (using Label[Err[E]]): T = r match - case r: Ok[_] => r.value + case r: Ok[?] => r.value case err => break(err.asInstanceOf[Err[E]]) /** If this is an `Err`, map its value */ def mapErr[E1](f: E => E1): Result[T, E1] = r match - case err: Err[_] => Err(f(err.value)) - case ok: Ok[_] => ok + case err: Err[?] => Err(f(err.value)) + case ok: Ok[?] => ok /** Map Ok values, propagate Errs */ def map[U](f: T => U): Result[U, E] = r match case Ok(x) => Ok(f(x)) - case err: Err[_] => err + case err: Err[?] => err /** Flatmap Ok values, propagate Errs */ def flatMap[U](f: T => Result[U, E]): Result[U, E] = r match case Ok(x) => f(x) - case err: Err[_] => err + case err: Err[?] => err /** Validate both `r` and `other`; return a pair of successes or a list of failures. */ def zip[U](other: Result[U, E]): Result[(T, U), List[E]] = (r, other) match diff --git a/tests/run/fully-abstract-interface.scala b/tests/run/fully-abstract-interface.scala index 34fa305ad229..3031b6098053 100644 --- a/tests/run/fully-abstract-interface.scala +++ b/tests/run/fully-abstract-interface.scala @@ -232,7 +232,7 @@ object ListImplementation extends Arithmetic { type Number = List[Any] def numberClassTag: ClassTag[Number] = new ClassTag[Number] { - def runtimeClass: Class[_] = classOf[List[_]] + def runtimeClass: Class[?] = classOf[List[?]] override def unapply(x: Any): Option[List[Any]] = x match { case ls: List[Any] if ls.length == 3 || (ls.length == 1 && ls(0).isInstanceOf[Int]) => // Test that it is one of: @@ -251,7 +251,7 @@ object ListImplementation extends Arithmetic { type Constant = List[Any] // List(n: Int) def constantClassTag: ClassTag[Constant] = new ClassTag[Constant] { - def runtimeClass: Class[_] = classOf[List[_]] + def runtimeClass: Class[?] = classOf[List[?]] override def unapply(x: Any): Option[List[Any]] = x match { case ls: List[Any] if ls.length == 1 && ls(0).isInstanceOf[Int] => // Test that it is: @@ -280,7 +280,7 @@ object ListImplementation extends Arithmetic { type AppliedOp = List[Any] // List(op: Op, lhs: Number, rhs: Number) def appliedOpClassTag: ClassTag[AppliedOp] = new ClassTag[AppliedOp] { - def runtimeClass: Class[_] = classOf[List[_]] + def runtimeClass: Class[?] = classOf[List[?]] override def unapply(x: Any): Option[List[Any]] = x match { case ls: List[Any] if ls.length == 3 => // Test that it is: @@ -302,7 +302,7 @@ object ListImplementation extends Arithmetic { type Op = List[Any] def opClassTag: ClassTag[Op] = new ClassTag[Constant] { - def runtimeClass: Class[_] = classOf[List[_]] + def runtimeClass: Class[?] = classOf[List[?]] override def unapply(x: Any): Option[List[Any]] = x match { case op @ (("+" | "*") :: Nil) => // Test that it is: diff --git a/tests/run/fully-abstract-nat.scala b/tests/run/fully-abstract-nat.scala index 2073d03b7313..65e8e066a42e 100644 --- a/tests/run/fully-abstract-nat.scala +++ b/tests/run/fully-abstract-nat.scala @@ -204,7 +204,7 @@ object IntImplementation extends Numbers { } private def intClassTag(cond: Int => Boolean): ClassTag[Int] = new ClassTag[Int] { - def runtimeClass: Class[_] = classOf[Int] + def runtimeClass: Class[?] = classOf[Int] override def unapply(x: Any): Option[Int] = x match { case i: Int if cond(i) => Some(i) case _ => None @@ -220,7 +220,7 @@ object UnboundedIntImplementation extends Numbers { type Nat = Any // Int | BigInt def natClassTag: ClassTag[Nat] = new ClassTag[Any] { - def runtimeClass: Class[_] = classOf[Any] + def runtimeClass: Class[?] = classOf[Any] override def unapply(x: Any): Option[Nat] = x match { case i: Int if i >= 0 => Some(i) case i: BigInt if i > Int.MaxValue => Some(i) @@ -246,7 +246,7 @@ object UnboundedIntImplementation extends Numbers { type Zero = Int def zeroClassTag: ClassTag[Zero] = new ClassTag[Int] { - def runtimeClass: Class[_] = classOf[Int] + def runtimeClass: Class[?] = classOf[Int] override def unapply(x: Any): Option[Int] = if (x == 0) Some(0) else None } @@ -260,7 +260,7 @@ object UnboundedIntImplementation extends Numbers { type Succ = Any // Int | BigInt def succClassTag: ClassTag[Succ] = new ClassTag[Any] { - def runtimeClass: Class[_] = classOf[Any] + def runtimeClass: Class[?] = classOf[Any] override def unapply(x: Any): Option[Succ] = x match { case i: Int if i > 0 => Some(i) case i: BigInt if i > Int.MaxValue => Some(i) diff --git a/tests/run/getclass.scala b/tests/run/getclass.scala index d8a339f8ea5a..c02f46119994 100644 --- a/tests/run/getclass.scala +++ b/tests/run/getclass.scala @@ -5,8 +5,8 @@ class SomeClass object Test { def main(args: Array[String]): Unit = { - val cls: Predef.Class[_] = new SomeClass().getClass - val valCls: Predef.Class[_] = new ValueClass(1).getClass + val cls: Predef.Class[?] = new SomeClass().getClass + val valCls: Predef.Class[?] = new ValueClass(1).getClass val iCls: Class[Int] = 1.getClass val f1: Function2[Int, Int, Unit] = (a: Int, b: Int) => println(a + b) val f2: Function1[Int, Boolean] = (a: Int) => a % 2 == 0 diff --git a/tests/run/i11486/Test_2.scala b/tests/run/i11486/Test_2.scala index 9ac8eed5ffc4..6362286b0914 100644 --- a/tests/run/i11486/Test_2.scala +++ b/tests/run/i11486/Test_2.scala @@ -6,7 +6,7 @@ case class Tested(foo: Int, bar: String, baz: Double): def target(abc: Tested, efg: Tested) = () def symbolic(`def`: Int, *** : Int, `unary_!`: Int) = () -def run(cls: Class[_]) = +def run(cls: Class[?]) = extension(m: Executable) def parameters: List[String] = m.getParameters.toList.map(_.getName) val ctorParams = cls.getConstructors.head.parameters diff --git a/tests/run/i11542.scala b/tests/run/i11542.scala index 32e940e745d0..62e5e332b210 100644 --- a/tests/run/i11542.scala +++ b/tests/run/i11542.scala @@ -4,14 +4,14 @@ object demo { given Reader[Int]() - inline def summonReader[T <: Tuple]: List[Reader[_]] = inline compiletime.erasedValue[T] match { + inline def summonReader[T <: Tuple]: List[Reader[?]] = inline compiletime.erasedValue[T] match { case _: EmptyTuple => Nil case _: (t *: ts) => compiletime.summonInline[Reader[t]] :: summonReader[ts] } class CombinedReader[A]( m: deriving.Mirror.ProductOf[A], - childReaders: List[Reader[_]] + childReaders: List[Reader[?]] ) extends Reader[A] inline given rdr[A <: Tuple](using m: deriving.Mirror.ProductOf[A]): Reader[A] = { diff --git a/tests/run/i11961.scala b/tests/run/i11961.scala index f289f6b415b6..68df07833c9f 100644 --- a/tests/run/i11961.scala +++ b/tests/run/i11961.scala @@ -23,7 +23,7 @@ object Printable: given Printable[Boolean] with def print: Unit = println("BOOLEAN") - def printProduct[T](p: Mirror.ProductOf[T], elems: => List[Printable[_]]): Printable[T] = + def printProduct[T](p: Mirror.ProductOf[T], elems: => List[Printable[?]]): Printable[T] = new Printable[T]: def print: Unit = elems.foreach(_.print) @@ -35,7 +35,7 @@ object Printable: end Printable -inline def summonAllPrintable[T <: Tuple]: List[Printable[_]] = +inline def summonAllPrintable[T <: Tuple]: List[Printable[?]] = inline erasedValue[T] match case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Printable[t]] :: summonAllPrintable[ts] diff --git a/tests/run/i13146.scala b/tests/run/i13146.scala index cbaee29a5ec0..4116de598468 100644 --- a/tests/run/i13146.scala +++ b/tests/run/i13146.scala @@ -1,7 +1,7 @@ import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} -inline def summonAll[T <: Tuple]: List[Eq[_]] = +inline def summonAll[T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts] @@ -13,18 +13,18 @@ object Eq: given Eq[Int] with def eqv(x: Int, y: Int) = x == y - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T]: def eqv(x: T, y: T): Boolean = val ordx = s.ordinal(x) (s.ordinal(y) == ordx) && check(elems(ordx))(x, y) - def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T]: def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/run/i13146a.scala b/tests/run/i13146a.scala index 37e135ac9f76..e4f52c5b8ea2 100644 --- a/tests/run/i13146a.scala +++ b/tests/run/i13146a.scala @@ -3,7 +3,7 @@ import scala.compiletime.{erasedValue, summonInline} // File that breaks the infinite loop caused by implicit search in i13146.scala -inline def summonAll[P, T <: Tuple]: List[Eq[_]] = +inline def summonAll[P, T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match case _: EmptyTuple => Nil case _: (t *: ts) => loopBreaker[P, t] :: summonAll[P, ts] @@ -29,18 +29,18 @@ object Eq: given Eq[Int] with def eqv(x: Int, y: Int) = x == y - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T]: def eqv(x: T, y: T): Boolean = val ordx = s.ordinal(x) (s.ordinal(y) == ordx) && check(elems(ordx))(x, y) - def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T]: def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/run/i1441.scala b/tests/run/i1441.scala index 01a0e611f6bc..fe877ce9af03 100644 --- a/tests/run/i1441.scala +++ b/tests/run/i1441.scala @@ -1,4 +1,4 @@ -class FrameworkTest(val cls: Class[_], val format: Int = 1, val expected: String) +class FrameworkTest(val cls: Class[?], val format: Int = 1, val expected: String) class FixtureFrameworkSuite object FixtureFrameworkSuite extends FrameworkTest( diff --git a/tests/run/i5077.scala b/tests/run/i5077.scala index 44fd2cb7bf47..dce74899b7c7 100644 --- a/tests/run/i5077.scala +++ b/tests/run/i5077.scala @@ -6,7 +6,7 @@ case class C[A](is: Is[A], value: A) @main def Test = { val c_string: C[String] = C(IsString, "name") - val c_any: C[_] = c_string + val c_any: C[?] = c_string val any: Any = c_string // Case 1: error, tested in tests/neg/i5077.scala diff --git a/tests/run/i7359.scala b/tests/run/i7359.scala index 69c50adf95da..99adc4a1d12a 100644 --- a/tests/run/i7359.scala +++ b/tests/run/i7359.scala @@ -32,7 +32,7 @@ object Test: def main(args: Array[String]): Unit = val samPlainWithExtends : SAMPlainWithExtends = () => "o" - val samCovariantOutExtends : SAMCovariantOutExtends[_] = () => "o" + val samCovariantOutExtends : SAMCovariantOutExtends[?] = () => "o" val samContravariantInExtends : SAMContravariantInExtends[Int] = (x: Int) => () val samInvariantExtends : SAMInvariantExtends[String] = (x: String) => x val samInOutExtends : SAMInOutExtends[Int, String] = (x: Int) => x.toString diff --git a/tests/run/i9011.scala b/tests/run/i9011.scala index 22ab9bc1e1a6..1faead8e9461 100644 --- a/tests/run/i9011.scala +++ b/tests/run/i9011.scala @@ -14,17 +14,17 @@ object Eq { def eqv(x: Int, y: Int) = x == y } - inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { + inline def summonAll[T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match { case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts] } - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = { val ordx = s.ordinal(x) @@ -32,7 +32,7 @@ object Eq { } } - def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/run/i9056.scala b/tests/run/i9056.scala index e7e37a4cf87f..84b71279aeca 100644 --- a/tests/run/i9056.scala +++ b/tests/run/i9056.scala @@ -12,8 +12,8 @@ assert(!("": Any).isInstanceOf[NonEmptyTuple]) assert(!(Some(""): Any).isInstanceOf[NonEmptyTuple]) - assert(!((): Any).isInstanceOf[_ *: _]) - assert((1, 2).isInstanceOf[_ *: _]) - assert((1, 2, 3).isInstanceOf[_ *: _]) - assert(!("": Any).isInstanceOf[_ *: _]) - assert(!(Some(""): Any).isInstanceOf[_ *: _]) + assert(!((): Any).isInstanceOf[? *: ?]) + assert((1, 2).isInstanceOf[? *: ?]) + assert((1, 2, 3).isInstanceOf[? *: ?]) + assert(!("": Any).isInstanceOf[? *: ?]) + assert(!(Some(""): Any).isInstanceOf[? *: ?]) diff --git a/tests/run/i9473.scala b/tests/run/i9473.scala index 384870ea42af..0863c9cfd9ab 100644 --- a/tests/run/i9473.scala +++ b/tests/run/i9473.scala @@ -1,7 +1,7 @@ import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} -inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { +inline def summonAll[T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match { case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts] } @@ -15,12 +15,12 @@ object Eq { def eqv(x: Int, y: Int) = x == y } - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = { val ordx = s.ordinal(x) @@ -28,7 +28,7 @@ object Eq { } } - def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: => List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/run/i9482.scala b/tests/run/i9482.scala index 425a9b333d29..8ad680c62f7d 100644 --- a/tests/run/i9482.scala +++ b/tests/run/i9482.scala @@ -5,7 +5,7 @@ object Ref { object Sentinel def makeWithArr[A: OptManifest]: String = optManifest[A] match { - case m: ClassTag[_] => m.newArray(0).asInstanceOf[AnyRef] match { + case m: ClassTag[?] => m.newArray(0).asInstanceOf[AnyRef] match { // these can be reordered, so long as Unit comes before AnyRef case _: Array[Boolean] => "bool" case _: Array[Byte] => "byte" diff --git a/tests/run/implied-for.scala b/tests/run/implied-for.scala index c7789ce570e4..58499156f407 100644 --- a/tests/run/implied-for.scala +++ b/tests/run/implied-for.scala @@ -14,14 +14,14 @@ object A { object Test extends App { import A.* - import A.{t, given B, given D[_]} + import A.{t, given B, given D[?]} val x1: B = b val x2: T = t val x3: D[Int] = d assert(summon[T].isInstanceOf[B]) - assert(summon[D[Int]].isInstanceOf[D[_]]) + assert(summon[D[Int]].isInstanceOf[D[?]]) } class Ordering[T] @@ -37,7 +37,7 @@ object Instances { } object Test2 { - import Instances.{given Ordering[_], given ExecutionContext} + import Instances.{given Ordering[?], given ExecutionContext} val x = intOrd val y = listOrd[Int] val z = ec @@ -47,7 +47,7 @@ object Test2 { } object Test3 { - import Instances.{im, given Ordering[_]} + import Instances.{im, given Ordering[?]} val x = intOrd val y = listOrd[Int] val z = im diff --git a/tests/run/inlineAddDeserializeLambda.scala b/tests/run/inlineAddDeserializeLambda.scala index 4280dea602b2..9e8a9a595557 100644 --- a/tests/run/inlineAddDeserializeLambda.scala +++ b/tests/run/inlineAddDeserializeLambda.scala @@ -18,5 +18,5 @@ object Test extends App { def serializeDeserialize[T <: AnyRef](obj: T) = deserialize(serialize(obj)).asInstanceOf[T] - assert(serializeDeserialize((new C).f).isInstanceOf[Function1[_, _]]) + assert(serializeDeserialize((new C).f).isInstanceOf[Function1[?, ?]]) } diff --git a/tests/run/iterator-from.scala b/tests/run/iterator-from.scala index 4e1649fff7e8..64aa486adc3c 100644 --- a/tests/run/iterator-from.scala +++ b/tests/run/iterator-from.scala @@ -38,7 +38,7 @@ object Test extends App { } } - def check[A](clazz: Class[_], list: List[_], m1: String, m2: String, l1: List[A], l2: List[A]): Unit = { + def check[A](clazz: Class[?], list: List[?], m1: String, m2: String, l1: List[A], l2: List[A]): Unit = { assertEquals(s"$clazz: `$m1` didn't match `$m2` on list $list", l1, l2) } diff --git a/tests/run/java-annot-params/run_1.scala b/tests/run/java-annot-params/run_1.scala index 0fe66f00a2e6..258daf3768ad 100644 --- a/tests/run/java-annot-params/run_1.scala +++ b/tests/run/java-annot-params/run_1.scala @@ -1,6 +1,6 @@ package annots -def runTest(cls: Class[_]): Unit = +def runTest(cls: Class[?]): Unit = val params = Option(cls.getAnnotation(classOf[WithClass])).map(_.arg) :: Option(cls.getAnnotation(classOf[WithClassDefaultName])).map(_.value) :: diff --git a/tests/run/junitForwarders/C_1.scala b/tests/run/junitForwarders/C_1.scala index cc5f94eed97f..e17add90b097 100644 --- a/tests/run/junitForwarders/C_1.scala +++ b/tests/run/junitForwarders/C_1.scala @@ -12,7 +12,7 @@ trait U { class C extends T object Test extends App { - def check(c: Class[_], e: String) = { + def check(c: Class[?], e: String) = { val s = c.getDeclaredMethods.sortBy(_.getName).map(m => s"${m.getName} - ${m.getDeclaredAnnotations.mkString(", ")}").mkString(";") assert(s == e, s"found: $s\nexpected: $e") } diff --git a/tests/run/lazy-impl.scala b/tests/run/lazy-impl.scala index c3e14be10b80..51a301c5bf5a 100644 --- a/tests/run/lazy-impl.scala +++ b/tests/run/lazy-impl.scala @@ -151,7 +151,7 @@ object LazyRuntime { f.get(null).asInstanceOf[sun.misc.Unsafe] } - def fieldOffset(cls: Class[_], name: String): Long = { + def fieldOffset(cls: Class[?], name: String): Long = { val fld = cls.getDeclaredField(name) fld.setAccessible(true) unsafe.objectFieldOffset(fld) diff --git a/tests/run/lst/Lst.scala b/tests/run/lst/Lst.scala index eecd471037d4..10a6f46ecc9b 100644 --- a/tests/run/lst/Lst.scala +++ b/tests/run/lst/Lst.scala @@ -451,7 +451,7 @@ class Lst[+T](val elems: Any) extends AnyVal { self => } override def equals(that: Any) = that match { - case that: Lst[_] => + case that: Lst[?] => (this `eqLst` that) || { elems match { case elems1: Arr => diff --git a/tests/run/manifest-summoning.scala b/tests/run/manifest-summoning.scala index f36296728699..7d3c4c960891 100644 --- a/tests/run/manifest-summoning.scala +++ b/tests/run/manifest-summoning.scala @@ -78,13 +78,13 @@ def noManifest[A: OptManifest] = def interopOpt[A: ClassTag: OptManifest] = assert(classTag[A] == optManifest[A]) optManifest[A] match - case optA: ClassTag[_] => + case optA: ClassTag[?] => assert(classTag[A].runtimeClass == optA.runtimeClass) def sameClassEqualOpt[A: OptManifest, B: OptManifest] = assert(optManifest[A] == optManifest[B]) (optManifest[A], optManifest[B]) match - case (a: ClassTag[_], b: ClassTag[_]) => + case (a: ClassTag[?], b: ClassTag[?]) => assert(a.runtimeClass == b.runtimeClass) def sameClassMan[A: Manifest, B: Manifest] = diff --git a/tests/run/mapConserve.scala b/tests/run/mapConserve.scala index af60746249b9..7171382b4f7b 100644 --- a/tests/run/mapConserve.scala +++ b/tests/run/mapConserve.scala @@ -17,7 +17,7 @@ object Test { assert(xs.mapConserve(x => x) eq xs) } - def checkBehaviourUnchanged(input: List[_], oldOutput: List[_], newOutput: List[_]): Unit = { + def checkBehaviourUnchanged(input: List[?], oldOutput: List[?], newOutput: List[?]): Unit = { if (oldOutput eq input) assert(newOutput eq oldOutput) else { diff --git a/tests/run/mixin-signatures.scala b/tests/run/mixin-signatures.scala index 2c6d0101b1c3..beca24acd5aa 100644 --- a/tests/run/mixin-signatures.scala +++ b/tests/run/mixin-signatures.scala @@ -85,7 +85,7 @@ object Test { // scala.tools.nsc.symtab.Flags.flagsToString(flags) } - def show(clazz: Class[_]): Unit = { + def show(clazz: Class[?]): Unit = { print(clazz.toString + " {") clazz.getMethods.sortBy(x => (x.getName, x.isBridge, x.toString)) filter (_.getName.length == 1) foreach { m => print("\n " + m + flagsString(m)) diff --git a/tests/run/null-and-intersect.scala b/tests/run/null-and-intersect.scala index 04552635551d..ffa7ddf23f2f 100644 --- a/tests/run/null-and-intersect.scala +++ b/tests/run/null-and-intersect.scala @@ -5,9 +5,9 @@ object Test { class Boppy extends Immutable def f[T](x: Iterable[T]) = x match { - case _: Map[_, _] => 3 - case _: Seq[_] => 2 - case _: Iterable[_] => 1 + case _: Map[?, ?] => 3 + case _: Seq[?] => 2 + case _: Iterable[?] => 1 case _ => 4 } def g(x: Bippy) = x match { diff --git a/tests/run/paramForwarding_separate/B_2.scala b/tests/run/paramForwarding_separate/B_2.scala index b044c3cad6bc..0a7b97053b72 100644 --- a/tests/run/paramForwarding_separate/B_2.scala +++ b/tests/run/paramForwarding_separate/B_2.scala @@ -5,7 +5,7 @@ class B(member: Int) extends SubA(member) { } object Test { - def printFields(cls: Class[_]) = + def printFields(cls: Class[?]) = println(cls.getDeclaredFields.map(_.toString).sorted.toList.mkString("\n")) def main(args: Array[String]): Unit = { diff --git a/tests/run/paramForwarding_together.scala b/tests/run/paramForwarding_together.scala index e2f48998f185..399d6e17c2eb 100644 --- a/tests/run/paramForwarding_together.scala +++ b/tests/run/paramForwarding_together.scala @@ -13,7 +13,7 @@ class B(member: Int) extends SubA(member) { } object Test { - def printFields(cls: Class[_]) = + def printFields(cls: Class[?]) = println(cls.getDeclaredFields.map(_.toString).sorted.toList.mkString("\n")) def main(args: Array[String]): Unit = { diff --git a/tests/run/paramForwarding_together_b.scala b/tests/run/paramForwarding_together_b.scala index e6fe15f5df56..55ddd2cbc38d 100644 --- a/tests/run/paramForwarding_together_b.scala +++ b/tests/run/paramForwarding_together_b.scala @@ -14,7 +14,7 @@ class A(val member: Int) { object Test { - def printFields(cls: Class[_]) = + def printFields(cls: Class[?]) = println(cls.getDeclaredFields.map(_.toString).sorted.toList.mkString("\n")) def main(args: Array[String]): Unit = { diff --git a/tests/run/range.scala b/tests/run/range.scala index 52f599e81964..a25d055966c2 100644 --- a/tests/run/range.scala +++ b/tests/run/range.scala @@ -55,7 +55,7 @@ object Test { def main(args: Array[String]): Unit = { implicit val imp1: Numeric.BigDecimalAsIfIntegral = Numeric.BigDecimalAsIfIntegral - val _grs = List[GR[_]]( + val _grs = List[GR[?]]( GR(BigDecimal(5.0)), GR(BigDecimal(0.25)), // scala/bug#9348 GR(BigInt(5)), diff --git a/tests/run/rescue-boundary.scala b/tests/run/rescue-boundary.scala index 3e7fe8508686..2e179804d9df 100644 --- a/tests/run/rescue-boundary.scala +++ b/tests/run/rescue-boundary.scala @@ -5,7 +5,7 @@ object lib: extension [T](op: => T) inline def rescue (fallback: => T) = try op catch - case ex: boundary.Break[_] => throw ex + case ex: boundary.Break[?] => throw ex case NonFatal(_) => fallback extension [T, E <: Throwable](op: => T) inline def rescue (fallback: PartialFunction[E, T]) = @@ -13,7 +13,7 @@ object lib: catch case ex: E => // user should never match `ReturnThrowable`, which breaks semantics of non-local return - if fallback.isDefinedAt(ex) && !ex.isInstanceOf[boundary.Break[_]] then fallback(ex) else throw ex + if fallback.isDefinedAt(ex) && !ex.isInstanceOf[boundary.Break[?]] then fallback(ex) else throw ex end lib import lib.* diff --git a/tests/run/rescue.scala b/tests/run/rescue.scala index a1e1f3200061..76b2a10a3896 100644 --- a/tests/run/rescue.scala +++ b/tests/run/rescue.scala @@ -14,7 +14,7 @@ object lib { // case ex: ReturnThrowable[_] => throw ex // bug #7041 case ex: E => // user should never match `ReturnThrowable`, which breaks semantics of non-local return - if (fallback.isDefinedAt(ex) && !ex.isInstanceOf[ReturnThrowable[_]]) fallback(ex) else throw ex + if (fallback.isDefinedAt(ex) && !ex.isInstanceOf[ReturnThrowable[?]]) fallback(ex) else throw ex } } diff --git a/tests/run/returning.scala b/tests/run/returning.scala index fd190de17ee1..f57a89dcde04 100644 --- a/tests/run/returning.scala +++ b/tests/run/returning.scala @@ -18,7 +18,7 @@ object NonLocalReturns { val returner = new ReturnThrowable[T] try op(using returner) catch { - case ex: ReturnThrowable[_] => + case ex: ReturnThrowable[?] => if (ex `eq` returner) ex.result.asInstanceOf[T] else throw ex } } diff --git a/tests/run/t1048.scala b/tests/run/t1048.scala index 5eaeaa25c6c3..bc1f84d2eb10 100644 --- a/tests/run/t1048.scala +++ b/tests/run/t1048.scala @@ -5,7 +5,7 @@ object E { } object Bug { - def bug[A](e: Either[W[_], A]) = e match { + def bug[A](e: Either[W[?], A]) = e match { case Left(E(x)) => 1 case Right(x) => 2 case _ => 3 diff --git a/tests/run/t13418.scala b/tests/run/t13418.scala index 344bae8a274b..44e55f1a5825 100644 --- a/tests/run/t13418.scala +++ b/tests/run/t13418.scala @@ -16,11 +16,11 @@ type Bar = [Q] =>> x1.Y[Q] case _: a1.B => println("ok") } y match { - case _: x2.Y[_] => println("wrong") - case _: x1.Y[_] => println("ok") + case _: x2.Y[?] => println("wrong") + case _: x1.Y[?] => println("ok") } y match { - case _: Foo[_] => println("wrong") - case _: Bar[_] => println("ok") + case _: Foo[?] => println("wrong") + case _: Bar[?] => println("ok") } } diff --git a/tests/run/t1434.scala b/tests/run/t1434.scala index 63bd88ec9083..a3a5e937770d 100644 --- a/tests/run/t1434.scala +++ b/tests/run/t1434.scala @@ -4,7 +4,7 @@ object Test { class C extends B def f(o: AnyRef) = o match { - case a: A[_] if(a.op != null) => "with op" + case a: A[?] if(a.op != null) => "with op" case c: C => "C" case b: B => "B" } diff --git a/tests/run/t2755.scala b/tests/run/t2755.scala index 8d10b567346b..fd2e5a14a447 100644 --- a/tests/run/t2755.scala +++ b/tests/run/t2755.scala @@ -7,16 +7,16 @@ object Test { case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 } - def f2(a: Array[_]) = a match { + def f2(a: Array[?]) = a match { case x: Array[Int] => x(0) case x: Array[Double] => 2 case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 } def f3[T](a: Array[T]) = a match { @@ -25,7 +25,7 @@ object Test { case x: Array[Float] => x.sum.toInt case x: Array[String] => x.size case x: Array[AnyRef] => 5 - case x: Array[_] => 6 + case x: Array[?] => 6 case _ => 7 } diff --git a/tests/run/t2867.scala b/tests/run/t2867.scala index 25e55eaecddd..163c4fe53c56 100644 --- a/tests/run/t2867.scala +++ b/tests/run/t2867.scala @@ -1,5 +1,5 @@ object Test { - case class A(l: List[_]*) + case class A(l: List[?]*) def main(args: Array[String]): Unit = { /** Kind of sneaking a slightly different test in here as well as diff --git a/tests/run/t3097.scala b/tests/run/t3097.scala index 4aaf8056caa2..762e2970090c 100644 --- a/tests/run/t3097.scala +++ b/tests/run/t3097.scala @@ -6,13 +6,13 @@ sealed trait IAtomicValue[O] extends ISimpleValue sealed trait IAbstractDoubleValue[O] extends IAtomicValue[O] sealed trait IDoubleValue extends IAbstractDoubleValue[Double] -case class ListValue(val items: List[IAtomicValue[_]]) extends IListValue +case class ListValue(val items: List[IAtomicValue[?]]) extends IListValue class DoubleValue(val data: Double) extends IDoubleValue object Test extends App { // match is exhaustive (new DoubleValue(1): ISimpleValue) match { case m: IListValue => println("list") - case a: IAtomicValue[_] => println("atomic") + case a: IAtomicValue[?] => println("atomic") } } diff --git a/tests/run/t3452a/S_1.scala b/tests/run/t3452a/S_1.scala index 791faf42fa40..085f2f9656e2 100644 --- a/tests/run/t3452a/S_1.scala +++ b/tests/run/t3452a/S_1.scala @@ -21,4 +21,4 @@ class UpRelation extends Relation [UpRow] class Correspondence [R <: Row] class UpCorrespondence extends Correspondence [UpRow] -class Mapping[MC <: Correspondence[_]] +class Mapping[MC <: Correspondence[?]] diff --git a/tests/run/t3452f.scala b/tests/run/t3452f.scala index af64f5c04229..e64eea5f616e 100644 --- a/tests/run/t3452f.scala +++ b/tests/run/t3452f.scala @@ -14,6 +14,6 @@ abstract class Set[A] extends GenSet[A] with SetLike[A,Set[A]] with GenSetTempla object Test { def main(args: Array[String]): Unit = { - locally(classOf[Set[_]]) // trigger classloading to verify class + locally(classOf[Set[?]]) // trigger classloading to verify class } } diff --git a/tests/run/t3603.scala b/tests/run/t3603.scala index a9c8fb5f56fd..09f5013fba15 100644 --- a/tests/run/t3603.scala +++ b/tests/run/t3603.scala @@ -4,10 +4,10 @@ object Test { val intmap = IntMap(1 -> 1, 2 -> 2) val intres = intmap.map { case (a, b) => (a, b.toString) } - assert(intres.isInstanceOf[IntMap[_]]) + assert(intres.isInstanceOf[IntMap[?]]) val longmap = LongMap(1L -> 1, 2L -> 2) val longres = longmap.map { case (a, b) => (a, b.toString) } - assert(longres.isInstanceOf[LongMap[_]]) + assert(longres.isInstanceOf[LongMap[?]]) } } diff --git a/tests/run/t4317/S_1.scala b/tests/run/t4317/S_1.scala index 2756c879ebd5..238cff29241a 100644 --- a/tests/run/t4317/S_1.scala +++ b/tests/run/t4317/S_1.scala @@ -1,11 +1,11 @@ import language.existentials object S_1 { - def foo1(x: Class[_ <: AnyRef]) = 0 - def foo2(x: Class[_ <: AnyRef], y: Int) = 99 + def foo1(x: Class[? <: AnyRef]) = 0 + def foo2(x: Class[? <: AnyRef], y: Int) = 99 def foo3[T](x: Int, y: Int) = x + y def foo4a(x: Unit): Unit = () def foo4[T](x: Unit): Unit = () def foo5[T <: Unit](x: T): T = sys.error("") - def foo6[T](x: Class[_], y: Class[T], z: Class[_ <: T]) = ((x, y, z)) + def foo6[T](x: Class[?], y: Class[T], z: Class[? <: T]) = ((x, y, z)) } diff --git a/tests/run/t4415.scala b/tests/run/t4415.scala index 33d3908693e9..6cad1f38470a 100644 --- a/tests/run/t4415.scala +++ b/tests/run/t4415.scala @@ -16,7 +16,7 @@ object Test { convert(new SubclassProperty) } - def convert(prop: TopProperty): MyProp[_] = { + def convert(prop: TopProperty): MyProp[?] = { prop match { /////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/tests/run/t4753.scala b/tests/run/t4753.scala index cfb252cbe527..ae7ebc8e1f23 100644 --- a/tests/run/t4753.scala +++ b/tests/run/t4753.scala @@ -1,5 +1,5 @@ trait A { - val actualType: Class[_] + val actualType: Class[?] } trait B extends A { final val actualType = classOf[Boolean] diff --git a/tests/run/t493.scala b/tests/run/t493.scala index 7aaad1fece1d..b0c087611810 100644 --- a/tests/run/t493.scala +++ b/tests/run/t493.scala @@ -10,8 +10,8 @@ object Test { def main(args:Array[String]) = { - assert(y("msg").isInstanceOf[Array[_]]) - assert(z("msg").isInstanceOf[Array[_]]) + assert(y("msg").isInstanceOf[Array[?]]) + assert(z("msg").isInstanceOf[Array[?]]) // these work, without producing a match error diff --git a/tests/run/t5053.scala b/tests/run/t5053.scala index 91a1fca1ac2c..ec270d83fb2d 100644 --- a/tests/run/t5053.scala +++ b/tests/run/t5053.scala @@ -4,14 +4,14 @@ import collection.View object Test extends App { { val (left, right) = Seq((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip - println(left.isInstanceOf[View[_]]) + println(left.isInstanceOf[View[?]]) val (l, m, r) = Seq((1, 1.0, "a"), (1, 1.0, "a"), (1, 1.0, "a"), (3, 3.0, "c")).view.unzip3 - println(l.isInstanceOf[View[_]]) + println(l.isInstanceOf[View[?]]) } { val (left, right) = Iterable((1, "a"), (1, "a"), (1, "a"), (3, "c")).view.unzip - println(left.isInstanceOf[View[_]]) + println(left.isInstanceOf[View[?]]) val (l, m, r) = Iterable((1, 1.0, "a"), (1, 1.0, "a"), (1, 1.0, "a"), (3, 3.0, "c")).view.unzip3 - println(l.isInstanceOf[View[_]]) + println(l.isInstanceOf[View[?]]) } } diff --git a/tests/run/t5201.scala b/tests/run/t5201.scala index 5c7855f46307..f46501271fa4 100644 --- a/tests/run/t5201.scala +++ b/tests/run/t5201.scala @@ -1,5 +1,5 @@ object Test extends App { // Now make sure we really get a view val seq = Seq(Seq(1, 2), Seq(3, 4)).view.flatten - Console.println(seq.isInstanceOf[collection.View[_]]) + Console.println(seq.isInstanceOf[collection.View[?]]) } diff --git a/tests/run/t5729.scala b/tests/run/t5729.scala index e643ed73ed67..0faa15293daa 100644 --- a/tests/run/t5729.scala +++ b/tests/run/t5729.scala @@ -1,7 +1,7 @@ trait T[X] object Test extends App { - def join(in: Seq[T[_]]): Int = 1 + def join(in: Seq[T[?]]): Int = 1 def join[S](in: Seq[T[S]]): String = "x" - val x = join(null: Seq[T[_]]) + val x = join(null: Seq[T[?]]) assert(x == 1) // first alt chosen, since second requires a capture conversion in adapt } diff --git a/tests/run/t6246.scala b/tests/run/t6246.scala index ef49a517c43f..495434f351d5 100644 --- a/tests/run/t6246.scala +++ b/tests/run/t6246.scala @@ -2,7 +2,7 @@ import scala.reflect.{ClassTag, classTag} @deprecated("Suppress warnings", since="2.11") object Test extends App { - def testValueClass(tag: ClassTag[_]): Unit = { + def testValueClass(tag: ClassTag[?]): Unit = { println(s"runtimeClass = ${tag.runtimeClass}, toString = ${tag.toString}") println(tag <:< tag) println(tag <:< ClassTag.AnyVal) diff --git a/tests/run/t6541.scala b/tests/run/t6541.scala index f1271436917d..2835a6fac8a3 100644 --- a/tests/run/t6541.scala +++ b/tests/run/t6541.scala @@ -1,10 +1,10 @@ class A class B[T](x: T) -case class C(a: A, b: B[_]) +case class C(a: A, b: B[?]) -case class D(a: A, b: B[_]*) +case class D(a: A, b: B[?]*) -case class E(c: Class[_]) +case class E(c: Class[?]) object Test extends App { def f1(c: C) = c match { diff --git a/tests/run/t7932.scala b/tests/run/t7932.scala index 243e50245c0c..878300b8643b 100644 --- a/tests/run/t7932.scala +++ b/tests/run/t7932.scala @@ -24,13 +24,13 @@ trait M2[F] { self: M1[F] => abstract class C extends M1[Float] with M2[Float] object Test { - def t(c: Class[_]) = { + def t(c: Class[?]) = { val ms = c.getMethods.filter(_.getName.startsWith("category")) println(ms.map(_.toGenericString).sorted.mkString("\n")) } def main(args: Array[String]): Unit = { t(classOf[C]) - t(classOf[M1[_]]) - t(classOf[M2[_]]) + t(classOf[M1[?]]) + t(classOf[M2[?]]) } } diff --git a/tests/run/t8199.scala b/tests/run/t8199.scala index e6168672d520..509cd267b426 100644 --- a/tests/run/t8199.scala +++ b/tests/run/t8199.scala @@ -35,7 +35,7 @@ trait trt01234567890 { def x = Test.checkCallerImplClassName() } } object Test extends App { - def check(c: Class[_]): Unit = { + def check(c: Class[?]): Unit = { checkClassName(c.getName) } def checkClassName(name: String): Unit = { diff --git a/tests/run/t8549b.scala b/tests/run/t8549b.scala index 9dfd60aaa1ef..fbf7ae6dd2ff 100644 --- a/tests/run/t8549b.scala +++ b/tests/run/t8549b.scala @@ -10,7 +10,7 @@ class D extends Serializable object Test extends App { - def checkId(cls: Class[_]): Unit = { + def checkId(cls: Class[?]): Unit = { val field = cls.getDeclaredField("serialVersionUID") assert(isPrivate(field.getModifiers)) field.setAccessible(true) diff --git a/tests/run/throws-annot.scala b/tests/run/throws-annot.scala index 444251c7f83b..723b95f00b8c 100644 --- a/tests/run/throws-annot.scala +++ b/tests/run/throws-annot.scala @@ -28,14 +28,14 @@ object TestThrows { def readNoEx(): Int } - def checkMethod(cls: Class[_], name: String): Unit = { + def checkMethod(cls: Class[?], name: String): Unit = { val method = cls.getMethod(name) println(name + " throws: " + method.getExceptionTypes.mkString("", ", ", "")) val annots = method.getDeclaredAnnotations.map(_.annotationType) println(name + " annotations: " + annots.mkString("", ", ", "")) } - def run(cls: Class[_]): Unit = { + def run(cls: Class[?]): Unit = { checkMethod(cls, "read") checkMethod(cls, "readWith2") checkMethod(cls, "readMixed") diff --git a/tests/run/traitNoInit.scala b/tests/run/traitNoInit.scala index a89cb4ddc092..0346d9da97c3 100644 --- a/tests/run/traitNoInit.scala +++ b/tests/run/traitNoInit.scala @@ -12,7 +12,7 @@ trait WithInit { trait Bar(x: Int) object Test { - def hasInit(cls: Class[_]) = cls.getMethods.map(_.toString).exists(_.contains("$init$")) + def hasInit(cls: Class[?]) = cls.getMethods.map(_.toString).exists(_.contains("$init$")) def main(args: Array[String]): Unit = { assert(!hasInit(classOf[NoInit])) assert(hasInit(classOf[WithInit])) diff --git a/tests/run/transparentArrowAssoc.scala b/tests/run/transparentArrowAssoc.scala index 29b228eeef46..2472dc43cae5 100644 --- a/tests/run/transparentArrowAssoc.scala +++ b/tests/run/transparentArrowAssoc.scala @@ -4,7 +4,7 @@ import scala.collection.mutable.{ Builder, ListBuffer } object Test { - private val defaultOrdering = Map[Numeric[_], Ordering[_]]( + private val defaultOrdering = Map[Numeric[?], Ordering[?]]( Numeric.BigIntIsIntegral -> Ordering.BigInt, Numeric.IntIsIntegral -> Ordering.Int ) diff --git a/tests/run/tuple-erased.scala b/tests/run/tuple-erased.scala index 83a7d81bbac5..b9e70e966fca 100644 --- a/tests/run/tuple-erased.scala +++ b/tests/run/tuple-erased.scala @@ -35,19 +35,19 @@ object Test { assert(t23.isInstanceOf[Product]) assert(t24.isInstanceOf[Product]) - assert(t02.asInstanceOf[*:[_, _]] == t02) - assert(t05.asInstanceOf[*:[_, _]] == t05) - assert(t21.asInstanceOf[*:[_, _]] == t21) - assert(t22.asInstanceOf[*:[_, _]] == t22) - assert(t23.asInstanceOf[*:[_, _]] == t23) - assert(t24.asInstanceOf[*:[_, _]] == t24) - - assert(t02.isInstanceOf[*:[_, _]]) - assert(t05.isInstanceOf[*:[_, _]]) - assert(t21.isInstanceOf[*:[_, _]]) - assert(t22.isInstanceOf[*:[_, _]]) - assert(t23.isInstanceOf[*:[_, _]]) - assert(t24.isInstanceOf[*:[_, _]]) + assert(t02.asInstanceOf[*:[?, ?]] == t02) + assert(t05.asInstanceOf[*:[?, ?]] == t05) + assert(t21.asInstanceOf[*:[?, ?]] == t21) + assert(t22.asInstanceOf[*:[?, ?]] == t22) + assert(t23.asInstanceOf[*:[?, ?]] == t23) + assert(t24.asInstanceOf[*:[?, ?]] == t24) + + assert(t02.isInstanceOf[*:[?, ?]]) + assert(t05.isInstanceOf[*:[?, ?]]) + assert(t21.isInstanceOf[*:[?, ?]]) + assert(t22.isInstanceOf[*:[?, ?]]) + assert(t23.isInstanceOf[*:[?, ?]]) + assert(t24.isInstanceOf[*:[?, ?]]) val x = Tuple() assert(x.asInstanceOf[Tuple] == x) diff --git a/tests/run/typeclass-derivation-doc-example.scala b/tests/run/typeclass-derivation-doc-example.scala index bc00311478bd..f51362a4f053 100644 --- a/tests/run/typeclass-derivation-doc-example.scala +++ b/tests/run/typeclass-derivation-doc-example.scala @@ -1,7 +1,7 @@ import scala.deriving.* import scala.compiletime.{erasedValue, summonInline} -inline def summonAll[T <: Tuple]: List[Eq[_]] = inline erasedValue[T] match { +inline def summonAll[T <: Tuple]: List[Eq[?]] = inline erasedValue[T] match { case _: EmptyTuple => Nil case _: (t *: ts) => summonInline[Eq[t]] :: summonAll[ts] } @@ -15,12 +15,12 @@ object Eq { def eqv(x: Int, y: Int) = x == y } - def check(elem: Eq[_])(x: Any, y: Any): Boolean = + def check(elem: Eq[?])(x: Any, y: Any): Boolean = elem.asInstanceOf[Eq[Any]].eqv(x, y) def iterator[T](p: T) = p.asInstanceOf[Product].productIterator - def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[_]]): Eq[T] = + def eqSum[T](s: Mirror.SumOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = { val ordx = s.ordinal(x) @@ -28,7 +28,7 @@ object Eq { } } - def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[_]]): Eq[T] = + def eqProduct[T](p: Mirror.ProductOf[T], elems: List[Eq[?]]): Eq[T] = new Eq[T] { def eqv(x: T, y: T): Boolean = iterator(x).zip(iterator(y)).zip(elems.iterator).forall { diff --git a/tests/run/typeclass-derivation2a.scala b/tests/run/typeclass-derivation2a.scala index b8c004b24cc0..8ebba4ea2199 100644 --- a/tests/run/typeclass-derivation2a.scala +++ b/tests/run/typeclass-derivation2a.scala @@ -250,7 +250,7 @@ object Eq { case _: Shape.Cases[alts] => xm.ordinal == ym.ordinal && eqlCases[alts](xm, ym, 0) - case _: Shape.Case[_, elems] => + case _: Shape.Case[?, elems] => eqlElems[elems](xm, ym, 0) } } @@ -314,7 +314,7 @@ object Pickler { inline def unpickleCases[T, Alts <: Tuple](r: Generic[T], buf: mutable.ListBuffer[Int], ordinal: Int, n: Int): T = inline erasedValue[Alts] match { - case _: (Shape.Case[_, elems] *: alts1) => + case _: (Shape.Case[?, elems] *: alts1) => if (n == ordinal) unpickleCase[T, elems](r, buf, ordinal) else unpickleCases[T, alts1](r, buf, ordinal, n + 1) case _ => @@ -328,14 +328,14 @@ object Pickler { case _: Shape.Cases[alts] => buf += xm.ordinal pickleCases[alts](buf, xm, 0) - case _: Shape.Case[_, elems] => + case _: Shape.Case[?, elems] => pickleElems[elems](buf, xm, 0) } } def unpickle(buf: mutable.ListBuffer[Int]): T = inline erasedValue[ev.Shape] match { case _: Shape.Cases[alts] => unpickleCases[T, alts](ev, buf, nextInt(buf), 0) - case _: Shape.Case[_, elems] => + case _: Shape.Case[?, elems] => unpickleCase[T, elems](ev, buf, 0) } } @@ -381,7 +381,7 @@ object Show { val args = inline erasedValue[ev.Shape] match { case _: Shape.Cases[alts] => showCases[alts](xm, 0) - case _: Shape.Case[_, elems] => + case _: Shape.Case[?, elems] => showElems[elems](xm, 0).mkString(", ") } s"${xm.caseLabel}($args)" diff --git a/tests/run/typeclass-derivation2b.scala b/tests/run/typeclass-derivation2b.scala index cbf094d4426e..a6078c1d0277 100644 --- a/tests/run/typeclass-derivation2b.scala +++ b/tests/run/typeclass-derivation2b.scala @@ -26,7 +26,7 @@ object TypeLevel { abstract class GenericSum[S] extends Generic[S] { def ordinal(x: S): Int - inline def alternative(inline n: Int): GenericProduct[_ <: S] + inline def alternative(inline n: Int): GenericProduct[? <: S] } abstract class GenericProduct[P] extends Generic[P] { @@ -46,10 +46,10 @@ object Lst { class GenericLst[T] extends GenericSum[Lst[T]] { override type Shape = (Cons[T], Nil.type) def ordinal(x: Lst[T]) = x match { - case x: Cons[_] => 0 + case x: Cons[?] => 0 case Nil => 1 } - transparent inline def alternative(inline n: Int): GenericProduct[_ <: Lst[T]] = + transparent inline def alternative(inline n: Int): GenericProduct[? <: Lst[T]] = inline n match { case 0 => Cons.GenericCons[T] case 1 => Nil.GenericNil diff --git a/tests/run/typeclass-derivation2d.scala b/tests/run/typeclass-derivation2d.scala index 635f531114bc..99331d5ad7c6 100644 --- a/tests/run/typeclass-derivation2d.scala +++ b/tests/run/typeclass-derivation2d.scala @@ -74,10 +74,10 @@ import Deriving.* sealed trait Lst[+T] // derives Eq, Pickler, Show object Lst extends Mirror.Sum { - type _MonoType = Lst[_] + type _MonoType = Lst[?] - def ordinal(x: Lst[_]) = x match { - case x: Cons[_] => 0 + def ordinal(x: Lst[?]) = x match { + case x: Cons[?] => 0 case Nil => 1 } @@ -89,11 +89,11 @@ object Lst extends Mirror.Sum { case class Cons[T](hd: T, tl: Lst[T]) extends Lst[T] object Cons extends Mirror.Product { - type _MonoType = Lst[_] + type _MonoType = Lst[?] def apply[T](x: T, xs: Lst[T]): Lst[T] = new Cons(x, xs) - def _fromProduct(p: Product): Cons[_] = + def _fromProduct(p: Product): Cons[?] = new Cons(productElement[Any](p, 0), productElement[Lst[Any]](p, 1)) implicit def mirror[T]: Mirror.Product { @@ -125,9 +125,9 @@ object Lst extends Mirror.Sum { case class Pair[T](x: T, y: T) // derives Eq, Pickler, Show object Pair extends Mirror.Product { - type _MonoType = Pair[_] + type _MonoType = Pair[?] - def _fromProduct(p: Product): Pair[_] = + def _fromProduct(p: Product): Pair[?] = Pair(productElement[Any](p, 0), productElement[Any](p, 1)) implicit def mirror[T]: Mirror.Product { @@ -148,11 +148,11 @@ object Pair extends Mirror.Product { sealed trait Either[+L, +R] extends Product with Serializable // derives Eq, Pickler, Show object Either extends Mirror.Sum { - type _MonoType = Either[_, _] + type _MonoType = Either[?, ?] - def ordinal(x: Either[_, _]) = x match { - case x: Left[_] => 0 - case x: Right[_] => 1 + def ordinal(x: Either[?, ?]) = x match { + case x: Left[?] => 0 + case x: Right[?] => 1 } implicit def mirror[L, R]: Mirror.Sum { @@ -169,8 +169,8 @@ case class Left[L](elem: L) extends Either[L, Nothing] case class Right[R](elem: R) extends Either[Nothing, R] object Left extends Mirror.Product { - type _MonoType = Left[_] - def _fromProduct(p: Product): Left[_] = Left(productElement[Any](p, 0)) + type _MonoType = Left[?] + def _fromProduct(p: Product): Left[?] = Left(productElement[Any](p, 0)) implicit def mirror[L]: Mirror.Product { type _MonoType = Left[L] type ElemTypes = L *: EmptyTuple @@ -180,8 +180,8 @@ object Left extends Mirror.Product { } object Right extends Mirror.Product { - type _MonoType = Right[_] - def _fromProduct(p: Product): Right[_] = Right(productElement[Any](p, 0)) + type _MonoType = Right[?] + def _fromProduct(p: Product): Right[?] = Right(productElement[Any](p, 0)) implicit def mirror[R]: Mirror.Product { type _MonoType = Right[R] type ElemTypes = R *: EmptyTuple @@ -359,7 +359,7 @@ object Show { Nil } - inline def showCase(x: Any, m: Mirror.ProductOf[_]): String = { + inline def showCase(x: Any, m: Mirror.ProductOf[?]): String = { val label = constValue[m.CaseLabel] inline m match { case m: Mirror.Singleton => label diff --git a/tests/run/value-class-extractor-2.scala b/tests/run/value-class-extractor-2.scala index 5850d42f037e..fa31ae86a46f 100644 --- a/tests/run/value-class-extractor-2.scala +++ b/tests/run/value-class-extractor-2.scala @@ -45,7 +45,7 @@ object ValueOpt { // 73: areturn def unapply(x: Any): Opt[String] = x match { case _: String => Opt("String") - case _: List[_] => Opt("List") + case _: List[?] => Opt("List") case _: Int => Opt("Int") case _ => Opt.None } @@ -85,7 +85,7 @@ object RegularOpt { // 65: areturn def unapply(x: Any): Option[String] = x match { case _: String => Some("String") - case _: List[_] => Some("List") + case _: List[?] => Some("List") case _: Int => Some("Int") case _ => None } diff --git a/tests/run/variable-pattern-access.scala b/tests/run/variable-pattern-access.scala index dcf9726be55e..2e666a5ab7cc 100644 --- a/tests/run/variable-pattern-access.scala +++ b/tests/run/variable-pattern-access.scala @@ -4,9 +4,9 @@ class A { val (a, b) = (1, 2) } object Test { - def printFields(cls: Class[_]) = + def printFields(cls: Class[?]) = println(cls.getDeclaredFields.map(_.toString).sorted.toList.mkString("\n")) - def printMethods(cls: Class[_]) = + def printMethods(cls: Class[?]) = println(cls.getDeclaredMethods.map(_.toString).sorted.toList.mkString("\n")) def main(args: Array[String]): Unit = { diff --git a/tests/run/withIndex.scala b/tests/run/withIndex.scala index d2a809d61835..9f404a5df3ee 100644 --- a/tests/run/withIndex.scala +++ b/tests/run/withIndex.scala @@ -11,7 +11,7 @@ object Test { Console.println(str.zipWithIndex.toList) assert { ary.zipWithIndex match { - case _: Array[Tuple2[_,_]] => true + case _: Array[Tuple2[?,?]] => true case _ => false } }