diff options
author | liu fengyun <liu@fengy.me> | 2017-04-14 07:44:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-14 07:44:10 +0200 |
commit | f20ca3d358c650f6a58528018aa7d848b1f6a28f (patch) | |
tree | caa559734278467838c669565f91a91803f32918 /tests/patmat/i2253.scala | |
parent | 9e45ad16d012e6a2ff3be411c2fe101b1c74b831 (diff) | |
parent | 1c900a35155c0b92fd3b96794ffb55c0b0c03d9c (diff) | |
download | dotty-f20ca3d358c650f6a58528018aa7d848b1f6a28f.tar.gz dotty-f20ca3d358c650f6a58528018aa7d848b1f6a28f.tar.bz2 dotty-f20ca3d358c650f6a58528018aa7d848b1f6a28f.zip |
Merge pull request #2261 from AleksanderBG/fix-2253
Fix #2253 edge cases: recurse into refined type
Diffstat (limited to 'tests/patmat/i2253.scala')
-rw-r--r-- | tests/patmat/i2253.scala | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tests/patmat/i2253.scala b/tests/patmat/i2253.scala index 8394a86df..0344a6a5d 100644 --- a/tests/patmat/i2253.scala +++ b/tests/patmat/i2253.scala @@ -1,7 +1,30 @@ sealed trait S -object O extends S + +object BodylessObject extends S + +object HasIntM extends S { + type M = Int +} + +object HasStringXStringM extends S { + type M = String + val x: String = "" +} + +object HasIntXStringM extends S { + type M = String + val x: Int = 0 +} + +object HasIntXIntM extends S { + type M = Int + val x: Int = 0 +} + trait T class Test { - def m(s: S { val x: Int }) = s match { case _: T => ; } -}
\ No newline at end of file + def onlyIntX(s: S { val x: Int }) = s match { case _: T => ; } + def exposeAlias1[I <: Int](s: S { type M = I; val x: Int }) = s match { case _: T => ; } + def exposeAlias2[I <: Int](s: S { val x: Int; type M = I }) = s match { case _: T => ; } +} |