IncompatibleClassChangeError bug

Remi Forax forax at univ-mlv.fr
Wed Jul 18 20:45:47 UTC 2018


If i read the error message correctly, it means that the lambda proxy is considered as a value type, which is quite cool be unexpected :)

Rémi

----- Mail original -----
> De: "Remi Forax" <forax at univ-mlv.fr>
> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
> Envoyé: Mercredi 18 Juillet 2018 22:39:37
> Objet: IncompatibleClassChangeError bug

> Hi all,
> a build from 39a2d3a3b101 breaks my tests with an IncompatibleClassChangeError.
> I have isolated the issue:
> 
> ---
> import java.util.function.IntFunction;
> 
> public class ArrayGeneratorBug {
> 
>  static __ByValue class Foo {
>    private final int x;
>    
>    public Foo(int x) {
>      this.x = x;
>    }
>  }
>  
>  private static <T> T[] gen(IntFunction<T[]> arrayCreator) {
>    return arrayCreator.apply(0);
>  }
>  
>  public static void main(String[] args) {
>    Foo[] array = gen(Foo[]::new);
>    System.out.println(array);
>  }
> }
> ---
> 
> At runtime something goes wrong:
> 
> /usr/jdk/jdk-11-lworld/bin/java -XX:+EnableValhalla ArrayGeneratorBug
> Exception in thread "main" java.lang.IncompatibleClassChangeError: signature
> (I)[LArrayGeneratorBug$Foo; inconsistent value type:
> ArrayGeneratorBug$$Lambda$1/0x0000000800060840 ArrayGeneratorBug
>	at ArrayGeneratorBug.gen(ArrayGeneratorBug.java:14)
>	at ArrayGeneratorBug.main(ArrayGeneratorBug.java:18)
> 
> regards,
> Rémi



More information about the valhalla-dev mailing list