tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

AoC issue: ambiguous targets error when accessing loop index var form lambda #2347

Closed fridis closed 4 months ago

fridis commented 11 months ago

This

for s := [1] : nil, s.filter x->d.bla
    d in [1]
do

produces

 > ./build//bin/fz test_ambiguous_targets.fz 

/home/fridi/fuzion/advent_of_code/fuzion_aoc/2023/10/test_ambiguous_targets.fz:1:33: error 1: Ambiguous targets found for call to 'd'
for s := [1] : nil, s.filter x->d.bla
--------------------------------^
Found several possible call targets within the current feature at different levels of outer features:
in '#loop0' found '#loop0.d' defined at /home/fridi/fuzion/advent_of_code/fuzion_aoc/2023/10/test_ambiguous_targets.fz:2:5:
    d in [1]
----^
and in '#loop0' found '#loop0.d' defined at /home/fridi/fuzion/advent_of_code/fuzion_aoc/2023/10/test_ambiguous_targets.fz:2:5:
    d in [1]
----^
and in 'universe' found 'd' defined at /home/fridi/fuzion/advent_of_code/fuzion_aoc/2023/10/test_ambiguous_targets.fz:2:5:
    d in [1]
----^
To solve this, you may qualify the feature using '#loop0.this.d' or '#loop0.this.d' or 'universe.this.d'.

one error.
michaellilltokiwa commented 4 months ago

fixed #3112