Skip to content

Commit f95ddb3

Browse files
committed
confirm that 3.7.0 PC handles members with symbolic names
1 parent 4f4cbee commit f95ddb3

File tree

6 files changed

+129
-22
lines changed

6 files changed

+129
-22
lines changed

scalafix-tests/input/src/main/scala-2/test/explicitResultTypes/ExplicitResultTypesBase.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,7 @@ object ExplicitResultTypesBase {
1919
private val g = 1
2020
private def h(a: Int) = ""
2121
private var i = 22
22-
private implicit var j = 1
2322
val k = (1, "msg")
24-
implicit val L = List(1)
25-
implicit val M = Map(1 -> "STRING")
26-
implicit def D = 2
27-
implicit def tparam[T](e: T) = e
28-
implicit def tparam2[T](e: T) = List(e)
29-
implicit def tparam3[T](e: T) = Map(e -> e)
30-
class implicitlytrick {
31-
implicit val s: _root_.java.lang.String = "string"
32-
implicit val x = implicitly[String]
33-
}
3423
def comment(x: Int) =
3524
// comment
3625
x + 2
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
rules = ExplicitResultTypes
3+
ExplicitResultTypes.memberKind = [Val, Def, Var]
4+
ExplicitResultTypes.memberVisibility = [Public, Protected]
5+
*/
6+
package test.explicitResultTypes
7+
8+
import scala.language.implicitConversions
9+
10+
object ExplicitResultTypesImplicit {
11+
private implicit var j = 1
12+
implicit val L = List(1)
13+
implicit val M = Map(1 -> "STRING")
14+
implicit def D = 2
15+
implicit def tparam[T](e: T) = e
16+
implicit def tparam2[T](e: T) = List(e)
17+
implicit def tparam3[T](e: T) = Map(e -> e)
18+
class implicitlytrick {
19+
implicit val s: _root_.java.lang.String = "string"
20+
implicit val x = implicitly[String]
21+
}
22+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
rules = ExplicitResultTypes
3+
ExplicitResultTypes.memberKind = [Val, Def, Var]
4+
ExplicitResultTypes.memberVisibility = [Public, Protected]
5+
*/
6+
package test.explicitResultTypes
7+
8+
import scala.language.implicitConversions
9+
10+
object ExplicitResultTypesBase {
11+
def none[T] = None.asInstanceOf[Option[T]]
12+
val a = 1 + 2
13+
def b() = "a" + "b"
14+
var c = 1 == 1
15+
protected val d = 1.0f
16+
protected def e(a: Int, b: Double) = a + b
17+
protected var f = (x: Int) => x + 1
18+
val f0 = () => 42
19+
private val g = 1
20+
private def h(a: Int) = ""
21+
private var i = 22
22+
val k = (1, "msg")
23+
def comment(x: Int) =
24+
// comment
25+
x + 2
26+
object ExtraSpace {
27+
def * = "abc".length
28+
def ! = "abc".length
29+
def foo_ = "abc".length
30+
def `x` = "abc".length
31+
def `x ` = "abc".length
32+
}
33+
locally {
34+
implicit val Implicit = scala.concurrent.Future.successful(2)
35+
val Var = scala.concurrent.Future.successful(2)
36+
val Val = scala.concurrent.Future.successful(2)
37+
def Def = scala.concurrent.Future.successful(2)
38+
}
39+
object unicode {
40+
object `->` {
41+
def unapply[S](in: (S, S)): Option[(S, S)] = Some(in)
42+
}
43+
val `→` = `->`
44+
}
45+
def tuple = null.asInstanceOf[((Int, String)) => String]
46+
}

scalafix-tests/output/src/main/scala-2/test/explicitResultTypes/ExplicitResultTypesBase.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,7 @@ object ExplicitResultTypesBase {
1515
private val g = 1
1616
private def h(a: Int) = ""
1717
private var i = 22
18-
private implicit var j = 1
1918
val k: (Int, String) = (1, "msg")
20-
implicit val L: List[Int] = List(1)
21-
implicit val M: Map[Int,String] = Map(1 -> "STRING")
22-
implicit def D = 2
23-
implicit def tparam[T](e: T) = e
24-
implicit def tparam2[T](e: T): List[T] = List(e)
25-
implicit def tparam3[T](e: T): Map[T,T] = Map(e -> e)
26-
class implicitlytrick {
27-
implicit val s: _root_.java.lang.String = "string"
28-
implicit val x = implicitly[String]
29-
}
3019
def comment(x: Int): Int =
3120
// comment
3221
x + 2
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
package test.explicitResultTypes
3+
4+
import scala.language.implicitConversions
5+
6+
object ExplicitResultTypesImplicit {
7+
private implicit var j = 1
8+
implicit val L: List[Int] = List(1)
9+
implicit val M: Map[Int,String] = Map(1 -> "STRING")
10+
implicit def D = 2
11+
implicit def tparam[T](e: T) = e
12+
implicit def tparam2[T](e: T): List[T] = List(e)
13+
implicit def tparam3[T](e: T): Map[T,T] = Map(e -> e)
14+
class implicitlytrick {
15+
implicit val s: _root_.java.lang.String = "string"
16+
implicit val x = implicitly[String]
17+
}
18+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
package test.explicitResultTypes
3+
4+
import scala.language.implicitConversions
5+
import scala.concurrent.Future
6+
7+
object ExplicitResultTypesBase {
8+
def none[T]: Option[T] = None.asInstanceOf[Option[T]]
9+
val a: Int = 1 + 2
10+
def b(): String = "a" + "b"
11+
var c: Boolean = 1 == 1
12+
protected val d = 1.0f
13+
protected def e(a: Int, b: Double): Double = a + b
14+
protected var f: Int => Int = (x: Int) => x + 1
15+
val f0: () => Int = () => 42
16+
private val g = 1
17+
private def h(a: Int) = ""
18+
private var i = 22
19+
val k: (Int, String) = (1, "msg")
20+
def comment(x: Int): Int =
21+
// comment
22+
x + 2
23+
object ExtraSpace {
24+
def * : Int = "abc".length
25+
def ! : Int = "abc".length
26+
def foo_ : Int = "abc".length
27+
def `x`: Int = "abc".length
28+
def `x `: Int = "abc".length
29+
}
30+
locally {
31+
implicit val Implicit: Future[Int] = scala.concurrent.Future.successful(2)
32+
val Var = scala.concurrent.Future.successful(2)
33+
val Val = scala.concurrent.Future.successful(2)
34+
def Def = scala.concurrent.Future.successful(2)
35+
}
36+
object unicode {
37+
object `->` {
38+
def unapply[S](in: (S, S)): Option[(S, S)] = Some(in)
39+
}
40+
val `→` = `->`
41+
}
42+
def tuple: ((Int, String)) => String = null.asInstanceOf[((Int, String)) => String]
43+
}

0 commit comments

Comments
 (0)