Skip to content

SAM type change causes undercompilation #830

@eed3si9n

Description

@eed3si9n

This is yet another example of Zinc lagging Scala language spec change.
https://www.scala-lang.org/news/2.12.0/#lambda-syntax-for-sam-types

steps

Haven't minimized it but I noticed while coding. First you have a Java interface in one subproject.

import java.nio.file.Path;
import java.util.Optional;

public interface SingleOutput {
    public Path getOutputDirectory();

    public default Optional<Path> getSingleOutput() {
        return Optional.of(getOutputDirectory());
    }
}

In another subproject, use it as SAM-type lambda:

val output: SingleOutput = () => RootFilePath.resolve("out")

Then change the Java interface..

import java.io.File;
import java.util.Optional;

public interface SingleOutput {
    public File getOutputDirectory();

    public default Optional< File > getSingleOutput() {
        return Optional.of(getOutputDirectory());
    }
}

problem

The Scala code is not invalidated. So locally compile keeps succeeding. On CI the build fails if it's compiled from scratch.

expectation

Invalidate correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/under_compilationZinc does not pick up compilation when needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions