Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Required named params not narrower than optional ones? #5688

Open p6rt opened 8 years ago

p6rt commented 8 years ago

Migrated from rt.perl.org#129329 (status was 'new')

Searchable as RT129329$

p6rt commented 8 years ago

From @lizmat

$ perl6 -e 'multi a($a,​:$enc,|c) { "enc" }; multi a($a,​:$gzip!,|c) { "gzip" }; say a("foo",​:gzip)’ enc

$ perl6 -e 'multi a($a,​:$gzip!,|c) { "gzip" }; multi a($a,​:$enc,|c) { "enc" }; say a("foo",​:gzip)’ gzip

In both cases I would expect to see “gzip”. But apparently the order in which the candidates occur is important, even though one would expect the required named to be tighter?

Of course, on could order the candidates so that the required nameds are seen first. However, that’s not an option if the first candidates are actually part of the setting :-( Which makes it quite hard to actually add candidates with extra nameds for builtins :-(

Liz