diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-04 06:32:58 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-04 06:32:58 -0700 |
commit | c7f70ed1ce245bb90473e188ead2ead66d7dd16a (patch) | |
tree | 5dc28bcba0a8c57af26a5d9db1cae98dd6844f87 /test | |
parent | e45b5f316233c1488459375865be7ef56fb4c609 (diff) | |
parent | 6917599b9bb5a316e0ce9e63927dae8c0f09c861 (diff) | |
download | scala-c7f70ed1ce245bb90473e188ead2ead66d7dd16a.tar.gz scala-c7f70ed1ce245bb90473e188ead2ead66d7dd16a.tar.bz2 scala-c7f70ed1ce245bb90473e188ead2ead66d7dd16a.zip |
Merge pull request #1230 from som-snytt/issue/6278-inline-class-synth-def
SI-6278 fixed: synthetic implicit def must sort with its associated impl...
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t6278-synth-def.scala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/t6278-synth-def.scala b/test/files/pos/t6278-synth-def.scala new file mode 100644 index 0000000000..b8b660fbe3 --- /dev/null +++ b/test/files/pos/t6278-synth-def.scala @@ -0,0 +1,30 @@ + +package t6278 + +import language.implicitConversions + +object test { + def ok() { + class Foo(val i: Int) { + def foo[A](body: =>A): A = body + } + implicit def toFoo(i: Int): Foo = new Foo(i) + + val k = 1 + k foo println("k?") + val j = 2 + } + def nope() { + implicit class Foo(val i: Int) { + def foo[A](body: =>A): A = body + } + + val k = 1 + k foo println("k?") + //lazy + val j = 2 + } + def main(args: Array[String]) { + ok(); nope() + } +} |