# New Ticket Created by  Elizabeth Mattijsen 
# Please include the string:  [perl #131290]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=131290 >


<lizmat>        m: class A { has Int $.a is default(42) }; dd A.new.a   # 
expected to see 42 there, not Int, so feels like "is default" on attrs isn't 
implemented?
<+camelia>      rakudo-moar a9a161: OUTPUT: «Int␤»
<lizmat>        m: my Int $a is default(42); say $a
<+camelia>      rakudo-moar a9a161: OUTPUT: «42␤»
<lizmat>        m: class A { has Int $.a is default(42) }; use nqp; dd 
nqp::getattr(A.CREATE,A,q/$!a/).VAR.default  # oddly enough, it appears to be 
set
<+camelia>      rakudo-moar a9a161: OUTPUT: «42␤»
<lizmat>        class A { has Int $!a is default(42); method a() is raw { $!a } 
}; dd A.CREATE.a   #  but this doesn't  :-(
<+camelia>      rakudo-moar a9a161: OUTPUT: «Int $!a = Int␤»


This doesn’t seem to be cause by BUILD, as the .CREATE part  bypasses all of 
that.

Weird!

Reply via email to