Projects

Ticket #549: macruby_bug

File macruby_bug, 401 bytes (added by sorin.ionescu@…, 2 years ago)
Line 
1#!/usr/bin/env macruby
2
3class Test
4  def initialize()
5        @foo = true
6  end
7 
8  def add(something)
9        puts "Is foo nil: #{@foo.nil?}"
10  end
11
12  @__types__ = self.new()
13
14  def self.add(something)
15        @__types__.add(something)
16  end
17end
18
19t = Test.new
20t.add(3)
21Test.add(4)
22
23# Output (MacRuby 0.5):
24# Is foo nil: false
25# Is foo nil: true
26#
27# Expected (Ruby 1.9.1/1.8.7):
28# Is foo nil: false
29# Is foo nil: false
30