WhileyCompiler icon indicating copy to clipboard operation
WhileyCompiler copied to clipboard

Subtyping for Explicit Casts

Open DavePearce opened this issue 6 years ago • 1 comments

(see also #845)

At the moment, there is no sutyping operator for casts. Thus, the following fails:

type Link is {int data}
type BigLink is {int data, int code}

function sum(Link l) -> int:
    return l.data

function sum2(BigLink l) -> int:
  return sum((Link) l)

DavePearce avatar Aug 01 '19 04:08 DavePearce

This is also causing me problems moving between different instances of dom::Element

DavePearce avatar Sep 15 '20 01:09 DavePearce