Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling abstract type feature results in cryptic error message #3359

Closed
fridis opened this issue Jul 11, 2024 · 0 comments
Closed

Calling abstract type feature results in cryptic error message #3359

fridis opened this issue Jul 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules optimizer/analyzer related to the Optimizer, i.e., while creating Fuzion IR from Fuzion Application

Comments

@fridis
Copy link
Member

fridis commented Jul 11, 2024

This

f.type.n
f is
  type.n unit => abstract

produces

 > ./build/bin/fz test_abstract_type_feature.fz 

/home/fridi/fuzion/work/test_abstract_type_feature.fz:1:8: error 1: NYI: in universe#0(0 args) at 805306370 no targets for Call f.type.n(outer f.type) unit target UNIT
f.type.n
-------^
Considered targets: program entry point
    |
    +- performs call universe#0 => *** VOID *** ENV: 'NO ENV'

one error.

The corresponding errors for normal abstract features are quite nice

f.n
g : f is
g.n
f is
  n unit => abstract

results in

 > ./build/bin/fz test_abstract_feature.fz 

/home/fridi/fuzion/work/test_abstract_feature.fz:2:1: error 1: Used abstract feature 'f.n' is not implemented by 'g'
g : f is
^
Feature 'g' instantiated at /home/fridi/fuzion/work/test_abstract_feature.fz:3:1:
g.n
^
inherits or declares abstract feature 'f.n' declared at /home/fridi/fuzion/work/test_abstract_feature.fz:5:3:
  n unit => abstract
--^
which is called at /home/fridi/fuzion/work/test_abstract_feature.fz:1:3:
f.n
--^
without providing an implementation


/home/fridi/fuzion/work/test_abstract_feature.fz:4:1: error 2: Used abstract feature 'f.n' is not implemented by 'f'
f is
^
Feature 'f' instantiated at /home/fridi/fuzion/work/test_abstract_feature.fz:1:1:
f.n
^
inherits or declares abstract feature 'f.n' declared at /home/fridi/fuzion/work/test_abstract_feature.fz:5:3:
  n unit => abstract
--^
which is called at /home/fridi/fuzion/work/test_abstract_feature.fz:1:3:
f.n
--^
without providing an implementation

2 errors.
@fridis fridis added bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules optimizer/analyzer related to the Optimizer, i.e., while creating Fuzion IR from Fuzion Application labels Jul 11, 2024
@fridis fridis self-assigned this Jul 11, 2024
maxteufel added a commit that referenced this issue Jul 17, 2024
…cryptic_error'

* origin/fix_3359_abstract_missing_cause_cryptic_error:
  tests: trick DFA to believe execution continues after call to abstract feature
  src: Fix constructor call source position in tests/abstractfeatures_negative
  air/dfa: Move reporting missing implementations of abstracts to DFA, fix #3359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working middle end related to the Middle End that creates Fuzion Application from Fuzion Modules optimizer/analyzer related to the Optimizer, i.e., while creating Fuzion IR from Fuzion Application
Projects
None yet
Development

No branches or pull requests

1 participant