forked from scalacenter/scalafix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExplicitResultTypes: Add (Skip)LocalImplicits tests. Ref scalacenter#…
- Loading branch information
Showing
8 changed files
with
86 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
scalafix-tests/input/src/main/scala/test/explicitResultTypes/LocalImplicits.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
rule = ExplicitResultTypes | ||
ExplicitResultTypes.skipLocalImplicits = false | ||
*/ | ||
package test.explicitResultTypes | ||
|
||
class LocalImplicits { | ||
trait T | ||
def f(): T = new T { | ||
implicit val i = 1 | ||
} | ||
def g(): Unit = { | ||
class C { | ||
implicit val i = 2 | ||
} | ||
} | ||
def h(): Unit = { | ||
implicit val i = 3 | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
scalafix-tests/input/src/main/scala/test/explicitResultTypes/SkipLocalImplicits.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
rule = ExplicitResultTypes | ||
*/ | ||
package test.explicitResultTypes | ||
|
||
class SkipLocalImplicits { | ||
trait T | ||
def f(): T = new T { | ||
implicit val i = 1 | ||
} | ||
def g(): Unit = { | ||
class C { | ||
implicit val i = 2 | ||
} | ||
} | ||
def h(): Unit = { | ||
implicit val i = 3 | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
scalafix-tests/output/src/main/scala/test/explicitResultTypes/LocalImplicits.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package test.explicitResultTypes | ||
|
||
class LocalImplicits { | ||
trait T | ||
def f(): T = new T { | ||
implicit val i: Int = 1 | ||
} | ||
def g(): Unit = { | ||
class C { | ||
implicit val i: Int = 2 | ||
} | ||
} | ||
def h(): Unit = { | ||
implicit val i: Int = 3 | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
scalafix-tests/output/src/main/scala/test/explicitResultTypes/SkipLocalImplicits.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package test.explicitResultTypes | ||
|
||
class SkipLocalImplicits { | ||
trait T | ||
def f(): T = new T { | ||
implicit val i: Int = 1 | ||
} | ||
def g(): Unit = { | ||
class C { | ||
implicit val i: Int = 2 | ||
} | ||
} | ||
def h(): Unit = { | ||
implicit val i = 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters