diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-05-09 19:10:37 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-05-11 17:55:21 +0200 |
commit | 82f3e49b37043e9f7661a43fe28c158dec4a3f31 (patch) | |
tree | c0b893ea954cc9ab0e88ff63baf7b9d80d6dab67 /test | |
parent | 2422b064e7a52c04dfb2239fc8e7b9ffbab24251 (diff) | |
download | scala-82f3e49b37043e9f7661a43fe28c158dec4a3f31.tar.gz scala-82f3e49b37043e9f7661a43fe28c158dec4a3f31.tar.bz2 scala-82f3e49b37043e9f7661a43fe28c158dec4a3f31.zip |
fixes a problem with an extractor object overloaded by a regular def
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/overloaded_extractor_and_regular_def.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/files/pos/overloaded_extractor_and_regular_def.scala b/test/files/pos/overloaded_extractor_and_regular_def.scala new file mode 100644 index 0000000000..c8e7da5cad --- /dev/null +++ b/test/files/pos/overloaded_extractor_and_regular_def.scala @@ -0,0 +1,32 @@ +trait TreesBase { + type Tree + + type Apply <: Tree + + val Apply: ApplyExtractor + + abstract class ApplyExtractor { + def apply(x: Int): Apply + def unapply(apply: Apply): Option[Int] + } +} + +trait TreesApi extends TreesBase { + def Apply(x: String) +} + +class Universe extends TreesApi { + abstract class Tree + case class Apply(x: Int) extends Tree + object Apply extends ApplyExtractor + def Apply(x: String) = Apply(x.toInt) +} + +object Test extends App { + def foo(tapi: TreesApi) { + import tapi._ + def bar(tree: Tree) { + val Apply(x) = tree + } + } +}
\ No newline at end of file |