isSubstitutable bug

Mandy Chung mandy.chung at oracle.com
Thu Jan 31 17:50:15 UTC 2019


Hi Remi,

I have created https://bugs.openjdk.java.net/browse/JDK-8218159
and will look into it.

Thanks for finding it.
Mandy

On 1/31/19 8:45 AM, Remi Forax wrote:
> Hi all,
> isSubstitutable doesn't seem to work when a value type is hidden behind an interface ?
> The following code prints true ??
> 
>    interface Fun {
>      String toString();
>      
>      static Fun of(int value, Object next) {
>        return new value Fun() {
>          public String toString() {
>            return value + " -> " + next;
>          }
>        };
>      }
> 
>      static void main(String[] args) {
>        System.out.println(ValueBootstrapMethods.isSubstitutable(Fun.of(1, null), Fun.of(2, null)));
>      }
>    }
> 
> Rémi
> 



More information about the valhalla-dev mailing list