rsc icon indicating copy to clipboard operation
rsc copied to clipboard

Don't ascribe type refinements in case of overrides with different modifier

Open wiwa opened this issue 6 years ago • 0 comments

Given:

  trait AC {
    def foo: Int
  }
  def ac = new AC {
    override val foo: Int = 0
  }

Obtained:

  def ac: AC { val foo: Int } = new AC {
    override val foo: Int = 0
  }

Expected:

  def ac: AC = new AC {
    override val foo: Int = 0
  }

This happens when overriding a def with val. Should figure out how this works in the context of lazy vals as well.

wiwa avatar Aug 08 '19 17:08 wiwa