isSubstitutable bug

Remi Forax forax at univ-mlv.fr
Thu Jan 31 16:45:35 UTC 2019


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