Const Assignment gives unexpected behaviour #19

Closed
morris opened this Issue Jul 7, 2009 · 2 comments

Projects

None yet

2 participants

@morris
morris commented Jul 7, 2009

Assigning to already defined constants gives unexpected behaviour or even segmentation faults. I have built from latest git. Examples:

String = nil
puts "foo"
=> Segmentation Fault

String = nil
class String; end
=> Segmentation Fault

Array = nil
puts "foo"
=> (Nothing gets printed)

Array = nil
class Array; end
=> (Nothing happens)

Fixnum = nil
puts 42
=> 42

Fixnum = nil
class Fixnum; end
=> Fixnum is not a class (TypeError) with backtrace: Exception occurred during top-level exception output! (THIS IS BAD)

In all of this, Fixnum seems to behave most correctly. I haven't tried any other constants.

@evanphx
Member
evanphx commented Oct 6, 2009

Reassigning these core constants is not supported. I'm not sure what the behavior should even be in the cases.

@evanphx
Member
evanphx commented Mar 27, 2010

This is not supported.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment