summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/object/type/incompatible-covariance.tig
blob: 0ef37f5e7b6fa297e8ec37e95ccf005a4a9a3f85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
let
  class Shape {}
  class Square extends Shape {}
  class Circle extends Shape {}

  function update_radius(circle : Circle) = ()

  var a := new Square
  var b := new Circle
in
  update_radius(b);
  update_radius(a)
end