Scala: order of definition for companion object vs case class

后端 未结 2 2057
不思量自难忘°
不思量自难忘° 2021-02-12 14:41

In Scala 2.9.1 I get the following behavior:

class Foo {
   case class X()
   object X            // this compiles

   def bar() {
      object Y         // this         


        
2条回答
  •  抹茶落季
    2021-02-12 15:29

    This is a known bug: SI-3772: companions and method-owned case classes. This is partially fixed, but the OP's issue still remains. Vote it up if you want it fixed.

提交回复
热议问题