diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:33:03 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-10 11:33:03 -0700 |
commit | 2ba98d18e216fbba378480ac6d790c5bea89f0b1 (patch) | |
tree | d9f8bfcdbe467dd540529ce7c364a7c65ed9369a /test/files | |
parent | 19e783b655576ecf2a32d2d0704657ba14940c8a (diff) | |
parent | ed723738e643035609efda49e6be689e4b0b0480 (diff) | |
download | scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.tar.gz scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.tar.bz2 scala-2ba98d18e216fbba378480ac6d790c5bea89f0b1.zip |
Merge pull request #1277 from som-snytt/issue-2.10/6278-inline-class-synth-def
SI-6278 fixed: synthetic implicit def must sort with its associated impl...
Diffstat (limited to 'test/files')
-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() + } +} |