Skip to content

Commit

Permalink
Fix scala#1828: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Mar 9, 2018
1 parent 6fb215f commit 4a47296
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/neg-custom-args/isInstanceOf/1828.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Test {
def remove[S](a: S | Int, f: Int => S):S = a match {
case a: S => a // error
case a: Int => f(a)
}

val t: Int | String = 5
val t1 = remove[String](t, _.toString)
}

0 comments on commit 4a47296

Please sign in to comment.