fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Missing error message in case of abstract type feature

Open fridis opened this issue 1 year ago • 0 comments

This example calls a type feature that is abstract

t is
  type.doit unit => abstract

test(X type : t) => X.doit

test t

which results in a NYI-error

 > ./build/bin/fz  call_type_feature.fz

/home/fridi/fuzion/work/call_type_feature.fz:4:23: error 1: NYI: in test t(0 args) at 805306372 no targets for Call (t.#type t).doit(outer t.#type t) unit target UNIT
test(X type : t) => X.doit
----------------------^^^^
Considered targets: 

program entry point
    |
    +- performs call universe#0 => *** VOID *** ENV: 'NO ENV'
      |
      +- performs call test t => *** VOID *** ENV: 'NO ENV'
/home/fridi/fuzion/work/call_type_feature.fz:6:1:
test t
^^^^
program entry point
    |
    +- performs call universe#0 => *** VOID *** ENV: 'NO ENV'
      |
      +- performs call test t => *** VOID *** ENV: 'NO ENV'
/home/fridi/fuzion/work/call_type_feature.fz:6:1:
test t
^^^^
program entry point
    |
    +- performs call universe#0 => *** VOID *** ENV: 'NO ENV'
      |
      +- performs call test t => *** VOID *** ENV: 'NO ENV'
/home/fridi/fuzion/work/call_type_feature.fz:6:1:
test t
^^^^
one error.

This is handled much nicer for a normal abstract feature

t ref is
  doit unit => abstract

test(x t) => x.doit

test t

that creates a normal error

 > ./build/bin/fz  call_abstract_feature.fz

/home/fridi/fuzion/work/call_abstract_feature.fz:1:1: error 1: Used abstract feature 't.doit' is not implemented by 't'
t ref is
^
Feature 't' instantiated at /home/fridi/fuzion/work/call_abstract_feature.fz:6:6:
test t
-----^
inherits or declares abstract feature 't.doit' declared at /home/fridi/fuzion/work/call_abstract_feature.fz:2:3:
  doit unit => abstract
--^^^^
which is called at /home/fridi/fuzion/work/call_abstract_feature.fz:4:16:
test(x t) => x.doit
---------------^^^^
without providing an implementation

one error.

fridis avatar May 28 '24 13:05 fridis