Bend/tests/golden_tests/run_file/guide_circle_area.bend
2024-05-22 21:25:31 +02:00

13 lines
279 B
Plaintext

type Shape:
Circle { radius }
Rectangle { width, height }
def area(shape):
match shape:
case Shape/Circle:
return 3.14 * shape.radius ** 2.0
case Shape/Rectangle:
return shape.width * shape.height
def main:
return area(Shape/Circle { radius: 10.0 })