Date.parse(nil) raises TypeError

V

Victor Kryukov

Hello,

in Ruby 1.9 (ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-
mingw32])

the following code

require 'date'
Date.parse(nil)

raises TypeError: can't dup NilClass. I think it should be
"ArgumentError: invalid date", same as what Date.parse reports for
strings with invalid date formats. Should I file a bug report?
 
R

Ryan Davis

Hello,
=20
in Ruby 1.9 (ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-
mingw32])
=20
the following code
=20
require 'date'
Date.parse(nil)
=20
raises TypeError: can't dup NilClass. I think it should be
"ArgumentError: invalid date", same as what Date.parse reports for
strings with invalid date formats. Should I file a bug report?

sure. you can even provide a patch that raises the exception you'd =
rather see. post your idea to ruby-core@
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top