develooper Front page | perl.perl6.users | Postings from December 2020

Missing NullPointerException

Thread Next
From:
Konrad Bucheli via perl6-users
Date:
December 2, 2020 06:06
Subject:
Missing NullPointerException
Message ID:
6afd1afb-596f-5fab-1e54-0187afa812f0@open-systems.com
Hi

I miss an error on my first invocation of `c` below:

$ raku
Welcome to 𝐑𝐚𝐤𝐮𝐝𝐨™ v2020.10.
Implementing the 𝐑𝐚𝐤𝐮™ programming language v6.d.
Built on MoarVM version 2020.10.

To exit type 'exit' or '^D'
 > class a { method b {return}}
(a)
 > say a.b.c
Nil
 > my $b = a.b
(Any)
 > say $b.c
No such method 'c' for invocant of type 'Any'
   in block <unit> at <unknown file> line 1

 >

Is there an explanation for that behavior?

Cheers

Konrad


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About