fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Inner feature inheriting from generic outer feature results in endless loop or recursion in front end

Open fridis opened this issue 4 years ago • 3 comments

This small example

> cat a.fz
a<T> is
  b : a<b> is

causes an endless loop or recursion in the front end:

 > timeout 3s ../build/bin/fz a || echo killed
killed

fridis avatar Jul 26 '21 16:07 fridis

the added regression test shows that this is not fixed.

fridis avatar Oct 25 '22 10:10 fridis

Updated example to current syntax:

a(T type) is
  b : a b is

this produces an error now (ambiguous type) before this hangs forever.

fridis avatar Mar 13 '23 13:03 fridis

The example

a(T type) is
  b : a b is

no longer results in fz hanging, but it produces a confusing error that references the declaration of b twice:

 > ./build//bin/fz a.fz

/home/fridi/fuzion/clean/fuzion.1/a.fz:2:9: error 1: Ambiguous type
  b : a b is

For a type used in a declaration, overloading results in an ambiguity that cannot be resolved by the compiler.
Type that is ambiguous: 'b'
Possible features that match this type: 
'a.b' defined at /home/fridi/fuzion/clean/fuzion.1/a.fz:2:3:
  b : a b is

and 'a.b' defined at /home/fridi/fuzion/clean/fuzion.1/a.fz:2:3:
  b : a b is


To solve this, rename these features such that each one has a unique name.

one error.

fridis avatar Jul 22 '24 11:07 fridis