Skip to content

Commit

Permalink
ExplicitResultTypes: Add (Skip)LocalImplicits tests. Ref scalacenter#…
Browse files Browse the repository at this point in the history
  • Loading branch information
giabao authored and mlachkar committed Jul 2, 2020
1 parent de34b72 commit d407e4b
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
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
}
}
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
}
}
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
}
}
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
}
}

0 comments on commit d407e4b

Please sign in to comment.