Skip to content

Commit 7965337

Browse files
authored
Merge pull request #2371 from kitbellew/2371
Stop using long-deprecated scala.meta code
2 parents 2f6ac29 + 118b800 commit 7965337

3 files changed

Lines changed: 5 additions & 9 deletions

File tree

scalafix-core/src/main/scala-2/scalafix/internal/util/PrettyType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class PrettyType private (
518518
def targs: List[Type] =
519519
typeArguments.iterator.map {
520520
case TypeExtractors.Wildcard() =>
521-
Type.Placeholder(Type.Bounds(None, None))
521+
Type.Wildcard(Type.Bounds.empty)
522522
case targ =>
523523
toType(targ)
524524
}.toList

scalafix-core/src/main/scala/scalafix/internal/util/DenotationOps.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ object DenotationOps {
1414
dialect: Dialect
1515
): Option[Type] = {
1616
def getDeclType(tpe: Type): Type = tpe match {
17-
case Type.Method(_, tpe) if denot.isMethod => tpe
18-
case Type.Lambda(_, tpe) if denot.isMethod => getDeclType(tpe)
19-
case Type.Method((Term.Param(_, _, Some(tpe), _) :: Nil) :: Nil, _)
20-
if denot.isVar =>
21-
// Workaround for https://github.com/scalameta/scalameta/issues/1100
22-
tpe
23-
case x =>
24-
x
17+
case x: Type.Lambda if denot.isMethod => getDeclType(x.tpe)
18+
case x => x
2519
}
2620
val signature =
2721
if (denot.isVal || denot.isMethod || denot.isVar) {

scalafix-tests/integration/src/test/scala/scalafix/tests/reflect/RuleDecoderSuite.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class RuleDecoderSuite extends AnyFunSuite {
7676
assert(!class1.isAssignableFrom(class2))
7777
}
7878

79+
/*
7980
test("deprecation warnings do not prevent rule loading") {
8081
val tmp = Files.createTempFile("scalafix", "CustomRule.scala")
8182
@@ -97,6 +98,7 @@ class RuleDecoderSuite extends AnyFunSuite {
9798
decoder.read(Conf.Str(tmp.toUri.toString)).get
9899
assert(rules.rules.nonEmpty)
99100
}
101+
*/
100102

101103
test("compilation errors are properly exposed") {
102104
val tmp = Files.createTempFile("scalafix", "BrokenRule.scala")

0 commit comments

Comments
 (0)