I was playing with the REPL:

> multi bar(Real) {say 'for Real'}
sub bar (Real $) { #`(Sub|116359088) ... }
> sub foo {bar 3i}
sub foo () { #`(Sub|146019408) ... }
> foo
Cannot call bar(Complex); none of these signatures match:
    (Real)
  in sub foo at <unknown file> line 1
  in block <unit> at <unknown file> line 1

so far so good... then


> multi bar(Complex) {say 'too Complex'}
sub bar (Complex $) { #`(Sub|146049808) ... }
> bar 3i
too Complex
> foo
Cannot call bar(Complex); none of these signatures match:
    (Real)
  in sub foo at <unknown file> line 1
  in block <unit> at <unknown file> line 1

I'd expect the 2nd call to "foo" to succeed, now that "bar" has a form
that accepts complex. Or, I'd expect "foo" to not even compile, if the
compiler wants to cache the multi "bar" at the time it sees its use.
What's going on?

-y

Reply via email to