zinc icon indicating copy to clipboard operation
zinc copied to clipboard

Zinc undercompile in case of construct like A.type#B#C when type behind C changes

Open romanowski opened this issue 7 years ago • 1 comments

Problem

When we have situation when e.g. object defines type:

// Providers.scala
trait Provider { type Operations = A } // trait A { def a = 1 } and trait B { def a = 1 } defined somewhere
object Providers { type SomeProvider = Provider }

In another place this type is used and e.g. return type

// Foo.scala
object Foo { def provide: Providers.type#SomeProvider#Operations = ??? }

and lastly it is those method is called:

// Bar.scala
object Bar { Foo.provide.a }

When we change type Operations = A to type Operations = BandFoo.provide.atoFoo.provide.b` and incremental compile we would get compilation error:

[error] Bar.scala:1:26: value b is not a member of A
[error] object Bar { Foo.provide.b }

When we e.g. add space (or any other way force compilation) in Foo.scala all compiles fine.

PR with tests for it is here #475

romanowski avatar Jan 06 '18 10:01 romanowski