diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index c9a7d5883150..ddf5f3dcaf7c 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit c9a7d5883150fba08942755867b619694aff498e +Subproject commit ddf5f3dcaf7c0e7893464a658e71020f2acc942c diff --git a/library/src/scala/tasty/reflect/ImplicitsOps.scala b/library/src/scala/tasty/reflect/ImplicitsOps.scala index a252c351bd04..36185d4e405d 100644 --- a/library/src/scala/tasty/reflect/ImplicitsOps.scala +++ b/library/src/scala/tasty/reflect/ImplicitsOps.scala @@ -7,40 +7,20 @@ trait ImplicitsOps extends Core { given (given Context): IsInstanceOf[ImplicitSearchSuccess] = internal.isInstanceOfImplicitSearchSuccess - object IsImplicitSearchSuccess - @deprecated("Use _: ImplicitSearchSuccess", "") - def unapply(isr: ImplicitSearchSuccess)(given ctx: Context): Option[ImplicitSearchSuccess] = Some(isr) - given successOps: extension (self: ImplicitSearchSuccess) { def tree(given ctx: Context): Term = internal.ImplicitSearchSuccess_tree(self) } given (given Context): IsInstanceOf[ImplicitSearchFailure] = internal.isInstanceOfImplicitSearchFailure - object IsImplicitSearchFailure - @deprecated("Use _: ImplicitSearchFailure", "") - def unapply(isr: ImplicitSearchFailure)(given ctx: Context): Option[ImplicitSearchFailure] = Some(isr) - given failureOps: extension (self: ImplicitSearchFailure) { def explanation(given ctx: Context): String = internal.ImplicitSearchFailure_explanation(self) } given (given Context): IsInstanceOf[DivergingImplicit] = internal.isInstanceOfDivergingImplicit - object IsDivergingImplicit - @deprecated("Use _: DivergingImplicit", "") - def unapply(isr: DivergingImplicit)(given ctx: Context): Option[DivergingImplicit] = Some(isr) - given (given Context): IsInstanceOf[NoMatchingImplicits] = internal.isInstanceOfNoMatchingImplicits - object IsNoMatchingImplicits - @deprecated("Use _: NoMatchingImplicits", "") - def unapply(isr: NoMatchingImplicits)(given ctx: Context): Option[NoMatchingImplicits] = Some(isr) - given (given Context): IsInstanceOf[AmbiguousImplicits] = internal.isInstanceOfAmbiguousImplicits - object IsAmbiguousImplicits - @deprecated("Use _: AmbiguousImplicits", "") - def unapply(isr: AmbiguousImplicits)(given ctx: Context): Option[AmbiguousImplicits] = Some(isr) - } diff --git a/library/src/scala/tasty/reflect/TreeOps.scala b/library/src/scala/tasty/reflect/TreeOps.scala index 4de77e207d75..9231ac404062 100644 --- a/library/src/scala/tasty/reflect/TreeOps.scala +++ b/library/src/scala/tasty/reflect/TreeOps.scala @@ -14,10 +14,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[PackageClause] = internal.isInstanceOfPackageClause - object IsPackageClause - @deprecated("Use _: PackageClause", "") - def unapply(x: PackageClause): Some[PackageClause] = Some(x) - object PackageClause { def apply(pid: Ref, stats: List[Tree])(given ctx: Context): PackageClause = internal.PackageClause_apply(pid, stats) @@ -34,10 +30,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Import] = internal.isInstanceOfImport - object IsImport - @deprecated("Use _: Import", "") - def unapply(x: Import): Some[Import] = Some(x) - object Import { def apply(expr: Term, selectors: List[ImportSelector])(given ctx: Context): Import = internal.Import_apply(expr, selectors) @@ -55,18 +47,10 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Statement] = internal.isInstanceOfStatement - object IsStatement - @deprecated("Use _: Statement", "") - def unapply(x: Statement): Option[Statement] = Some(x) - // ----- Definitions ---------------------------------------------- given (given Context): IsInstanceOf[Definition] = internal.isInstanceOfDefinition - object IsDefinition - @deprecated("Use _: Definition", "") - def unapply(x: Definition): Option[Definition] = Some(x) - given DefinitionOps: extension (self: Definition) { def name(given ctx: Context): String = internal.Definition_name(self) } @@ -75,10 +59,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[ClassDef] = internal.isInstanceOfClassDef - object IsClassDef - @deprecated("Use _: ClassDef", "") - def unapply(x: ClassDef): Some[ClassDef] = Some(x) - object ClassDef { // TODO def apply(name: String, constr: DefDef, parents: List[TermOrTypeTree], selfOpt: Option[ValDef], body: List[Statement])(given ctx: Context): ClassDef def copy(original: Tree)(name: String, constr: DefDef, parents: List[Tree /* Term | TypeTree */], derived: List[TypeTree], selfOpt: Option[ValDef], body: List[Statement])(given ctx: Context): ClassDef = @@ -99,10 +79,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[DefDef] = internal.isInstanceOfDefDef - object IsDefDef - @deprecated("Use _: DefDef", "") - def unapply(x: DefDef): Some[DefDef] = Some(x) - object DefDef { def apply(symbol: Symbol, rhsFn: List[Type] => List[List[Term]] => Option[Term])(given ctx: Context): DefDef = internal.DefDef_apply(symbol, rhsFn) @@ -123,10 +99,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[ValDef] = internal.isInstanceOfValDef - object IsValDef - @deprecated("Use _: ValDef", "") - def unapply(x: ValDef): Some[ValDef] = Some(x) - object ValDef { def apply(symbol: Symbol, rhs: Option[Term])(given ctx: Context): ValDef = internal.ValDef_apply(symbol, rhs) @@ -145,10 +117,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeDef] = internal.isInstanceOfTypeDef - object IsTypeDef - @deprecated("Use _: TypeDef", "") - def unapply(x: TypeDef): Some[TypeDef] = Some(x) - object TypeDef { def apply(symbol: Symbol)(given ctx: Context): TypeDef = internal.TypeDef_apply(symbol) @@ -171,10 +139,6 @@ trait TreeOps extends Core { def members(given ctx: Context): List[Statement] = internal.PackageDef_members(self) } - object IsPackageDef - @deprecated("Use _: PackageDef", "") - def unapply(x: PackageDef): Some[PackageDef] = Some(x) - object PackageDef { def unapply(tree: PackageDef)(given ctx: Context): Option[(String, PackageDef)] = Some((tree.name, tree.owner)) @@ -229,16 +193,8 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Term] = internal.isInstanceOfTerm - object IsTerm - @deprecated("Use _: Term", "") - def unapply(x: Term): Some[Term] = Some(x) - given (given Context): IsInstanceOf[Ref] = internal.isInstanceOfRef - object IsRef - @deprecated("Use _: Ref", "") - def unapply(x: Ref): Some[Ref] = Some(x) - object Ref { /** Create a reference tree from a symbol @@ -266,10 +222,6 @@ trait TreeOps extends Core { } /** Scala term identifier */ - object IsIdent - @deprecated("Use _: Ident", "") - def unapply(x: Ident): Some[Ident] = Some(x) - object Ident { def apply(tmref: TermRef)(given ctx: Context): Term = internal.Ident_apply(tmref) @@ -285,10 +237,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Select] = internal.isInstanceOfSelect /** Scala term selection */ - object IsSelect - @deprecated("Use _: Select", "") - def unapply(x: Select): Some[Select] = Some(x) - object Select { /** Select a term member by symbol */ def apply(qualifier: Term, symbol: Symbol)(given ctx: Context): Select = @@ -326,10 +274,6 @@ trait TreeOps extends Core { internal.isInstanceOfLiteral /** Scala literal constant */ - object IsLiteral - @deprecated("Use _: Literal", "") - def unapply(x: Literal): Some[Literal] = Some(x) - object Literal { /** Create a literal constant */ @@ -351,10 +295,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[This] = internal.isInstanceOfThis /** Scala `this` or `this[id]` */ - object IsThis - @deprecated("Use _: This", "") - def unapply(x: This): Some[This] = Some(x) - object This { /** Create a `this[` */ @@ -376,10 +316,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[New] = internal.isInstanceOfNew /** Scala `new` */ - object IsNew - @deprecated("Use _: New", "") - def unapply(x: New): Some[New] = Some(x) - object New { /** Create a `new ` */ @@ -400,10 +336,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[NamedArg] = internal.isInstanceOfNamedArg /** Scala named argument `x = y` in argument position */ - object IsNamedArg - @deprecated("Use _: NamedArg", "") - def unapply(x: NamedArg): Some[NamedArg] = Some(x) - object NamedArg { /** Create a named argument ` = ` */ @@ -427,10 +359,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Apply] = internal.isInstanceOfApply /** Scala parameter application */ - object IsApply - @deprecated("Use _: Apply", "") - def unapply(x: Apply): Some[Apply] = Some(x) - object Apply { /** Create a function application `()` */ @@ -453,10 +381,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeApply] = internal.isInstanceOfTypeApply /** Scala type parameter application */ - object IsTypeApply - @deprecated("Use _: TypeApply", "") - def unapply(x: TypeApply): Some[TypeApply] = Some(x) - object TypeApply { /** Create a function type application `[]` */ @@ -480,9 +404,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Super] = internal.isInstanceOfSuper /** Scala `x.super` or `x.super[id]` */ - object IsSuper - @deprecated("Use _: Super", "") - def unapply(x: Super): Some[Super] = Some(x) object Super { @@ -506,10 +427,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Typed] = internal.isInstanceOfTyped /** Scala ascription `x: T` */ - object IsTyped - @deprecated("Use _: Typed", "") - def unapply(x: Typed): Some[Typed] = Some(x) - object Typed { /** Create a type ascription `: ` */ @@ -533,10 +450,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Assign] = internal.isInstanceOfAssign /** Scala assign `x = y` */ - object IsAssign - @deprecated("Use _: Assign", "") - def unapply(x: Assign): Some[Assign] = Some(x) - object Assign { /** Create an assignment ` = ` */ @@ -559,9 +472,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Block] = internal.isInstanceOfBlock /** Scala code block `{ stat0; ...; statN; expr }` term */ - object IsBlock - @deprecated("Use _: Block", "") - def unapply(x: Block): Some[Block] = Some(x) object Block { @@ -584,10 +494,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Closure] = internal.isInstanceOfClosure - object IsClosure - @deprecated("Use _: Closure", "") - def unapply(x: Closure): Some[Closure] = Some(x) - object Closure { def apply(meth: Term, tpt: Option[Type])(given ctx: Context): Closure = @@ -633,10 +539,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[If] = internal.isInstanceOfIf - object IsIf - @deprecated("Use _: If", "") - def unapply(x: If): Some[If] = Some(x) - /** Scala `if`/`else` term */ object If { @@ -662,10 +564,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Match] = internal.isInstanceOfMatch /** Scala `match` term */ - object IsMatch - @deprecated("Use _: Match", "") - def unapply(x: Match): Some[Match] = Some(x) - object Match { /** Creates a pattern match ` match { }` */ @@ -689,9 +587,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[GivenMatch] = internal.isInstanceOfGivenMatch /** Scala implicit `match` term */ - object IsGivenMatch - @deprecated("Use _: GivenMatch", "") - def unapply(x: GivenMatch): Some[GivenMatch] = Some(x) object GivenMatch { @@ -714,10 +609,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Try] = internal.isInstanceOfTry /** Scala `try`/`catch`/`finally` term */ - object IsTry - @deprecated("Use _: Try", "") - def unapply(x: Try): Some[Try] = Some(x) - object Try { /** Create a try/catch `try catch { } finally ` */ @@ -742,10 +633,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Return] = internal.isInstanceOfReturn /** Scala local `return` */ - object IsReturn - @deprecated("Use _: Return", "") - def unapply(x: Return): Some[Return] = Some(x) - object Return { /** Creates `return ` */ @@ -766,10 +653,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Repeated] = internal.isInstanceOfRepeated - object IsRepeated - @deprecated("Use _: Repeated", "") - def unapply(x: Repeated): Some[Repeated] = Some(x) - object Repeated { def apply(elems: List[Term], tpt: TypeTree)(given ctx: Context): Repeated = @@ -790,10 +673,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Inlined] = internal.isInstanceOfInlined - object IsInlined - @deprecated("Use _: Inlined", "") - def unapply(x: Inlined): Some[Inlined] = Some(x) - object Inlined { def apply(call: Option[Tree /* Term | TypeTree */], bindings: List[Definition], expansion: Term)(given ctx: Context): Inlined = @@ -815,10 +694,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[SelectOuter] = internal.isInstanceOfSelectOuter - object IsSelectOuter - @deprecated("Use _: SelectOuter", "") - def unapply(x: SelectOuter): Some[SelectOuter] = Some(x) - object SelectOuter { def apply(qualifier: Term, name: String, levels: Int)(given ctx: Context): SelectOuter = @@ -839,10 +714,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[While] = internal.isInstanceOfWhile - object IsWhile - @deprecated("Use _: While", "") - def unapply(x: While): Some[While] = Some(x) - object While { /** Creates a while loop `while () ` and returns (, ) */ @@ -873,17 +744,9 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeTree] = internal.isInstanceOfTypeTree - object IsTypeTree - @deprecated("Use _: TypeTree", "") - def unapply(x: TypeTree): Option[TypeTree] = Some(x) - given (given Context): IsInstanceOf[Inferred] = internal.isInstanceOfInferred /** TypeTree containing an inferred type */ - object IsInferred - @deprecated("Use _: Inferred", "") - def unapply(x: Inferred): Some[Inferred] = Some(x) - object Inferred { def apply(tpe: Type)(given ctx: Context): Inferred = internal.Inferred_apply(tpe) @@ -897,10 +760,6 @@ trait TreeOps extends Core { def name(given ctx: Context): String = internal.TypeIdent_name(self) } - object IsTypeIdent - @deprecated("Use _: TypeIdent", "") - def unapply(x: TypeIdent): Some[TypeIdent] = Some(x) - object TypeIdent { def apply(sym: Symbol)(given ctx: Context): TypeTree = internal.TypeRef_apply(sym) @@ -911,10 +770,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeSelect] = internal.isInstanceOfTypeSelect - object IsTypeSelect - @deprecated("Use _: TypeSelect", "") - def unapply(x: TypeSelect): Some[TypeSelect] = Some(x) - object TypeSelect { def apply(qualifier: Term, name: String)(given ctx: Context): TypeSelect = internal.TypeSelect_apply(qualifier, name) @@ -931,10 +786,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Projection] = internal.isInstanceOfProjection - object IsProjection - @deprecated("Use _: Projection", "") - def unapply(x: Projection): Some[Projection] = Some(x) - object Projection { // TODO def apply(qualifier: TypeTree, name: String)(given ctx: Context): Project def copy(original: Tree)(qualifier: TypeTree, name: String)(given ctx: Context): Projection = @@ -951,10 +802,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Singleton] = internal.isInstanceOfSingleton - object IsSingleton - @deprecated("Use _: Singleton", "") - def unapply(x: Singleton): Some[Singleton] = Some(x) - object Singleton { def apply(ref: Term)(given ctx: Context): Singleton = internal.Singleton_apply(ref) @@ -970,10 +817,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Refined] = internal.isInstanceOfRefined - object IsRefined - @deprecated("Use _: Refined", "") - def unapply(x: Refined): Some[Refined] = Some(x) - object Refined { // TODO def apply(tpt: TypeTree, refinements: List[Definition])(given ctx: Context): Refined def copy(original: Tree)(tpt: TypeTree, refinements: List[Definition])(given ctx: Context): Refined = @@ -989,10 +832,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Applied] = internal.isInstanceOfApplied - object IsApplied - @deprecated("Use _: Applied", "") - def unapply(x: Applied): Some[Applied] = Some(x) - object Applied { def apply(tpt: TypeTree, args: List[Tree /*TypeTree | TypeBoundsTree*/])(given ctx: Context): Applied = internal.Applied_apply(tpt, args) @@ -1010,10 +849,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Annotated] = internal.isInstanceOfAnnotated - object IsAnnotated - @deprecated("Use _: Annotated", "") - def unapply(x: Annotated): Some[Annotated] = Some(x) - object Annotated { def apply(arg: TypeTree, annotation: Term)(given ctx: Context): Annotated = internal.Annotated_apply(arg, annotation) @@ -1031,10 +866,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[MatchTypeTree] = internal.isInstanceOfMatchTypeTree - object IsMatchTypeTree - @deprecated("Use _: MatchTypeTree", "") - def unapply(x: MatchTypeTree): Some[MatchTypeTree] = Some(x) - object MatchTypeTree { def apply(bound: Option[TypeTree], selector: TypeTree, cases: List[TypeCaseDef])(given ctx: Context): MatchTypeTree = internal.MatchTypeTree_apply(bound, selector, cases) @@ -1053,10 +884,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[ByName] = internal.isInstanceOfByName - object IsByName - @deprecated("Use _: ByName", "") - def unapply(x: ByName): Some[ByName] = Some(x) - object ByName { def apply(result: TypeTree)(given ctx: Context): ByName = internal.ByName_apply(result) @@ -1072,10 +899,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[LambdaTypeTree] = internal.isInstanceOfLambdaTypeTree - object IsLambdaTypeTree - @deprecated("Use _: LambdaTypeTree", "") - def unapply(x: LambdaTypeTree): Some[LambdaTypeTree] = Some(x) - object LambdaTypeTree { def apply(tparams: List[TypeDef], body: Tree /*TypeTree | TypeBoundsTree*/)(given ctx: Context): LambdaTypeTree = internal.Lambdaapply(tparams, body) @@ -1092,10 +915,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeBind] = internal.isInstanceOfTypeBind - object IsTypeBind - @deprecated("Use _: TypeBind", "") - def unapply(x: TypeBind): Some[TypeBind] = Some(x) - object TypeBind { // TODO def apply(name: String, tree: Tree)(given ctx: Context): TypeBind def copy(original: Tree)(name: String, tpt: Tree /*TypeTree | TypeBoundsTree*/)(given ctx: Context): TypeBind = @@ -1111,10 +930,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeBlock] = internal.isInstanceOfTypeBlock - object IsTypeBlock - @deprecated("Use _: TypeBlock", "") - def unapply(x: TypeBlock): Some[TypeBlock] = Some(x) - object TypeBlock { def apply(aliases: List[TypeDef], tpt: TypeTree)(given ctx: Context): TypeBlock = internal.TypeBlock_apply(aliases, tpt) @@ -1139,10 +954,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeBoundsTree] = internal.isInstanceOfTypeBoundsTree - object IsTypeBoundsTree - @deprecated("Use _: TypeBoundsTree", "") - def unapply(x: TypeBoundsTree): Some[TypeBoundsTree] = Some(x) - object TypeBoundsTree { def unapply(x: TypeBoundsTree)(given ctx: Context): Option[(TypeTree, TypeTree)] = Some((x.low, x.hi)) @@ -1154,11 +965,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[WildcardTypeTree] = internal.isInstanceOfWildcardTypeTree - /** TypeBoundsTree containing wildcard type bounds */ - object IsWildcardTypeTree - @deprecated("Use _: WildcardTypeTree", "") - def unapply(x: WildcardTypeTree): Some[WildcardTypeTree] = Some(x) - object WildcardTypeTree { /** Matches a TypeBoundsTree containing wildcard type bounds */ def unapply(x: WildcardTypeTree)(given ctx: Context): Boolean = true @@ -1174,10 +980,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[CaseDef] = internal.isInstanceOfCaseDef - object IsCaseDef - @deprecated("Use _: CaseDef", "") - def unapply(x: CaseDef): Some[CaseDef] = Some(x) - object CaseDef { def apply(pattern: Tree, guard: Option[Term], rhs: Term)(given ctx: Context): CaseDef = internal.CaseDef_module_apply(pattern, guard, rhs) @@ -1197,10 +999,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[TypeCaseDef] = internal.isInstanceOfTypeCaseDef - object IsTypeCaseDef - @deprecated("Use _: TypeCaseDef", "") - def unapply(x: TypeCaseDef): Some[TypeCaseDef] = Some(x) - object TypeCaseDef { def apply(pattern: TypeTree, rhs: TypeTree)(given ctx: Context): TypeCaseDef = internal.TypeCaseDef_module_apply(pattern, rhs) @@ -1216,10 +1014,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Bind] = internal.isInstanceOfBind - object IsBind - @deprecated("Use _: Bind", "") - def unapply(x: Bind): Some[Bind] = Some(x) - object Bind { // TODO def apply(name: String, pattern: Tree)(given ctx: Context): Bind def copy(original: Tree)(name: String, pattern: Tree)(given ctx: Context): Bind = @@ -1235,10 +1029,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Unapply] = internal.isInstanceOfUnapply - object IsUnapply - @deprecated("Use _: Unapply", "") - def unapply(x: Unapply): Some[Unapply] = Some(x) - object Unapply { // TODO def apply(fun: Term, implicits: List[Term], patterns: List[Tree])(given ctx: Context): Unapply def copy(original: Tree)(fun: Term, implicits: List[Term], patterns: List[Tree])(given ctx: Context): Unapply = @@ -1255,10 +1045,6 @@ trait TreeOps extends Core { given (given Context): IsInstanceOf[Alternatives] = internal.isInstanceOfAlternatives - object IsAlternatives - @deprecated("Use _: Alternatives", "") - def unapply(x: Alternatives): Some[Alternatives] = Some(x) - object Alternatives { def apply(patterns: List[Tree])(given ctx: Context): Alternatives = internal.Tree_Alternatives_module_apply(patterns) diff --git a/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala b/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala index b8205fa0ed2a..1f5d2021ea20 100644 --- a/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala +++ b/library/src/scala/tasty/reflect/TypeOrBoundsOps.scala @@ -86,11 +86,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[Type] = internal.isInstanceOfType - object IsType - @deprecated("Use _: Type", "") - def unapply(x: Type)(given ctx: Context): Option[Type] = - internal.isInstanceOfType.unapply(x) - object Type { def apply(clazz: Class[_])(given ctx: Context): Type = internal.Type_apply(clazz) @@ -98,10 +93,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[ConstantType] = internal.isInstanceOfConstantType - object IsConstantType - @deprecated("Use _: ConstantType", "") - def unapply(x: ConstantType)(given ctx: Context): Option[ConstantType] = Some(x) - object ConstantType { def apply(x : Constant)(given ctx: Context): ConstantType = internal.ConstantType_apply(x) def unapply(x: ConstantType)(given ctx: Context): Option[Constant] = Some(x.constant) @@ -113,10 +104,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[TermRef] = internal.isInstanceOfTermRef - object IsTermRef - @deprecated("Use _: TermRef", "") - def unapply(x: TermRef)(given ctx: Context): Option[TermRef] = Some(x) - object TermRef { def apply(qual: TypeOrBounds, name: String)(given ctx: Context): TermRef = internal.TermRef_apply(qual, name) @@ -131,10 +118,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[TypeRef] = internal.isInstanceOfTypeRef - object IsTypeRef - @deprecated("Use _: TypeRef", "") - def unapply(x: TypeRef)(given ctx: Context): Option[TypeRef] = Some(x) - object TypeRef { def unapply(x: TypeRef)(given ctx: Context): Option[(TypeOrBounds /* Type | NoPrefix */, String)] = Some((x.qualifier, x.name)) @@ -147,10 +130,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[SuperType] = internal.isInstanceOfSuperType - object IsSuperType - @deprecated("Use _: SuperType", "") - def unapply(x: SuperType)(given ctx: Context): Option[SuperType] = Some(x) - object SuperType { def unapply(x: SuperType)(given ctx: Context): Option[(Type, Type)] = Some((x.thistpe, x.supertpe)) @@ -163,10 +142,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[Refinement] = internal.isInstanceOfRefinement - object IsRefinement - @deprecated("Use _: Refinement", "") - def unapply(x: Refinement)(given ctx: Context): Option[Refinement] = Some(x) - object Refinement { def apply(parent: Type, name: String, info: TypeOrBounds /* Type | TypeBounds */)(given ctx: Context): Refinement = internal.Refinement_apply(parent, name, info) @@ -183,10 +158,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[AppliedType] = internal.isInstanceOfAppliedType - object IsAppliedType - @deprecated("Use _: AppliedType", "") - def unapply(x: AppliedType)(given ctx: Context): Option[AppliedType] = Some(x) - object AppliedType { def apply(tycon: Type, args: List[TypeOrBounds])(given ctx: Context): AppliedType = internal.AppliedType_apply(tycon, args) @@ -201,10 +172,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[AnnotatedType] = internal.isInstanceOfAnnotatedType - object IsAnnotatedType - @deprecated("Use _: AnnotatedType", "") - def unapply(x: AnnotatedType)(given ctx: Context): Option[AnnotatedType] = Some(x) - object AnnotatedType { def apply(underlying: Type, annot: Term)(given ctx: Context): AnnotatedType = internal.AnnotatedType_apply(underlying, annot) @@ -219,10 +186,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[AndType] = internal.isInstanceOfAndType - object IsAndType - @deprecated("Use _: AndType", "") - def unapply(x: AndType)(given ctx: Context): Option[AndType] = Some(x) - object AndType { def apply(lhs: Type, rhs: Type)(given ctx: Context): AndType = internal.AndType_apply(lhs, rhs) @@ -237,10 +200,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[OrType] = internal.isInstanceOfOrType - object IsOrType - @deprecated("Use _: OrType", "") - def unapply(x: OrType)(given ctx: Context): Option[OrType] = Some(x) - object OrType { def apply(lhs: Type, rhs: Type)(given ctx: Context): OrType = internal.OrType_apply(lhs, rhs) def unapply(x: OrType)(given ctx: Context): Option[(Type, Type)] = @@ -254,10 +213,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[MatchType] = internal.isInstanceOfMatchType - object IsMatchType - @deprecated("Use _: MatchType", "") - def unapply(x: MatchType)(given ctx: Context): Option[MatchType] = Some(x) - object MatchType { def apply(bound: Type, scrutinee: Type, cases: List[Type])(given ctx: Context): MatchType = internal.MatchType_apply(bound, scrutinee, cases) @@ -281,10 +236,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[ByNameType] = internal.isInstanceOfByNameType - object IsByNameType - @deprecated("Use _: ByNameType", "") - def unapply(x: ByNameType)(given ctx: Context): Option[ByNameType] = Some(x) - object ByNameType { def apply(underlying: Type)(given ctx: Context): Type = internal.ByNameType_apply(underlying) def unapply(x: ByNameType)(given ctx: Context): Option[Type] = Some(x.underlying) @@ -296,10 +247,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[ParamRef] = internal.isInstanceOfParamRef - object IsParamRef - @deprecated("Use _: ParamRef", "") - def unapply(x: ParamRef)(given ctx: Context): Option[ParamRef] = Some(x) - object ParamRef { def unapply(x: ParamRef)(given ctx: Context): Option[(LambdaType[TypeOrBounds], Int)] = Some((x.binder, x.paramNum)) @@ -312,10 +259,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[ThisType] = internal.isInstanceOfThisType - object IsThisType - @deprecated("Use _: ThisType", "") - def unapply(x: ThisType)(given ctx: Context): Option[ThisType] = Some(x) - object ThisType { def unapply(x: ThisType)(given ctx: Context): Option[Type] = Some(x.tref) } @@ -326,10 +269,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[RecursiveThis] = internal.isInstanceOfRecursiveThis - object IsRecursiveThis - @deprecated("Use _: RecursiveThis", "") - def unapply(x: RecursiveThis)(given ctx: Context): Option[RecursiveThis] = Some(x) - object RecursiveThis { def unapply(x: RecursiveThis)(given ctx: Context): Option[RecursiveType] = Some(x.binder) } @@ -340,10 +279,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[RecursiveType] = internal.isInstanceOfRecursiveType - object IsRecursiveType - @deprecated("Use _: RecursiveType", "") - def unapply(x: RecursiveType)(given ctx: Context): Option[RecursiveType] = Some(x) - object RecursiveType { def unapply(x: RecursiveType)(given ctx: Context): Option[Type] = Some(x.underlying) } @@ -354,10 +289,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[MethodType] = internal.isInstanceOfMethodType - object IsMethodType - @deprecated("Use _: MethodType", "") - def unapply(x: MethodType)(given ctx: Context): Option[MethodType] = Some(x) - object MethodType { def apply(paramNames: List[String])(paramInfosExp: MethodType => List[Type], resultTypeExp: MethodType => Type): MethodType = internal.MethodType_apply(paramNames)(paramInfosExp, resultTypeExp) @@ -377,10 +308,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[PolyType] = internal.isInstanceOfPolyType - object IsPolyType - @deprecated("Use _: PolyType", "") - def unapply(x: PolyType)(given ctx: Context): Option[PolyType] = Some(x) - object PolyType { def apply(paramNames: List[String])(paramBoundsExp: PolyType => List[TypeBounds], resultTypeExp: PolyType => Type)(given ctx: Context): PolyType = internal.PolyType_apply(paramNames)(paramBoundsExp, resultTypeExp) @@ -397,10 +324,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[TypeLambda] = internal.isInstanceOfTypeLambda - object IsTypeLambda - @deprecated("Use _: TypeLambda", "") - def unapply(x: TypeLambda)(given ctx: Context): Option[TypeLambda] = Some(x) - object TypeLambda { def apply(paramNames: List[String], boundsFn: TypeLambda => List[TypeBounds], bodyFn: TypeLambda => Type): TypeLambda = internal.TypeLambda_apply(paramNames, boundsFn, bodyFn) @@ -419,10 +342,6 @@ trait TypeOrBoundsOps extends Core { given (given Context): IsInstanceOf[TypeBounds] = internal.isInstanceOfTypeBounds - object IsTypeBounds - @deprecated("Use _: TypeBounds", "") - def unapply(x: TypeBounds)(given ctx: Context): Option[TypeBounds] = Some(x) - object TypeBounds { def apply(low: Type, hi: Type)(given ctx: Context): TypeBounds = internal.TypeBounds_apply(low, hi) diff --git a/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala b/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala index 661612640c66..85e64f5e137b 100644 --- a/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala +++ b/tests/pos-special/fatal-warnings/tasty-parent-unapply.scala @@ -11,20 +11,20 @@ object Macros { def foo(tree: Tree, term: Term, typeTree: TypeTree, parent: Tree) = { tree match { - case IsTerm(tree) => + case tree: Tree => } term match { - case IsTerm(term) => + case term: Term => } typeTree match { - case IsTypeTree(typeTree) => + case typeTree: TypeTree => } parent match { - case IsTerm(typeTree) => - case IsTypeTree(typeTree) => + case typeTree: Term => + case typeTree: TypeTree => } }