fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

result type should not be inferred from implementation of abstract routine.

Open fridis opened this issue 1 year ago • 0 comments

This test

test_infer_abstract_result is

  a is
    f => abstract

  b : a is
    redef f => 42

should produce an error for a.f since no result type is given, but instead we get an error at b.f:

 > ./build/bin/fz test_infer_abstract_result.fz

/home/fridi/fuzion/work/test_infer_abstract_result.fz:7:11: error 1: Wrong result type in redefined feature
    redef f => 42
----------^
In 'test_infer_abstract_result.b.f' that redefines 'test_infer_abstract_result.a.f'
result type is       : 'i32'
result type should be: 'unit'

Original feature declared at /home/fridi/fuzion/work/test_infer_abstract_result.fz:4:5:
    f => abstract
----^
To solve this, change type of result to 'unit'

one error.

fridis avatar May 03 '24 09:05 fridis