fuzion
fuzion copied to clipboard
Inner feature inheriting from generic outer feature results in endless loop or recursion in front end
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
the added regression test shows that this is not fixed.
Updated example to current syntax:
a(T type) is
b : a b is
this produces an error now (ambiguous type) before this hangs forever.
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.