fork download
  1. #!/usr/bin/perl6
  2. class Valute {
  3. has Str $.currency is rw = "test";
  4. has $.fun;
  5.  
  6. method new(Str $currency_?, Str :$currency = $currency_) {
  7. say "asd";
  8.  
  9. }
  10.  
  11. method fun{
  12. self.currency.say
  13. }
  14.  
  15. }
  16. my $a = Valute.new(currency=>"asdf");
  17. $a.fun;
Runtime error #stdin #stdout #stderr 0.16s 102848KB
stdin
Standard input is empty
stdout
asd
stderr
No such method 'fun' for invocant of type 'Bool'
  in block <unit> at prog.pl line 17