Skip to content

Inox does not compile on Scala 3.3.1 + #210

Closed
@sankalpgambhir

Description

@sankalpgambhir

Inox is currently on Scala 3.3.0, and fails to compile on 3.3.1 or higher. I noticed this while updated my build to update dependencies generally.

The following error is raised:

[error] -- Error: <working_dir>/src/main/scala/inox/solvers/SolverFactory.scala:207:14 
[error] 207 |        class NativeZ3OptImpl(override val program: p.type)
[error]     |              ^
[error]     |parent trait NativeZ3Optimizer has a super call which binds to the value inox.solvers.unrolling.AbstractUnrollingSolver.targetProgram. Super calls can only target methods.
[error] one error found

The error seems to be due to a pattern that was disallowed in Scala 3.3.1 (scala/scala3#16908) as in the following minimal example:

trait A              { def f: String }
trait B extends A    { def f = "B" }
trait C extends A    { override val f = "C" }
trait D extends A, B { def d = f }
trait E extends A, B { def d = super.f }

class O1 extends A, B, C, D // passes (why though?)
class O2 extends A, B, C, E // fails

A val overrides a def in a parent trait, and there is an ambiguous access through a subclass. I don't get why leaving out the super. causes it to work.

In any case, despite the error message, a simple search shows that the Inox code base has no instance of def targetProgram or super.targetProgram, so it's not obvious where this is coming from. I do not see any other clear super calls accessing vals either. It would need some more investigation.

This also seems to only happen for that single instance (and commenting it out leads to a successful compile) suggesting that the error is isolated, and not a more global pattern problem.

If anyone else has ideas about what is causing this, it would be helpful to hear them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions