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


Date.new permits the construction of a Date object with the undefined
Int type object as the year number.  The undefined object can then be
retrieved through .year.  Many other operations on the Date fail as a
result of the undefined year:

> Date.new(Int,1,1).year.perl
Int
> Date.new(Int,1,1).Str
Invocant requires an instance of type Int, but a type object was passed.  Did 
you forget a .new?
> Date.new(Int,1,1).perl
Use of uninitialized value $!year of type Int in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. 
 in block <unit> at <unknown file> line 1
Date.new(,1,1)

It is nonsensical to construct a Date object that does not have a specific
integral year number.  A better type constraint is required.

-zefram

Reply via email to