Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #31 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

Problems calling NSNumber#intValue

Reported by: lsansonetti@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.1
Component: MacRuby Keywords:
Cc:

Description

First, it doesn't seem possible to call #intValue on an NSCFNumber that was created from Ruby

$ ./miniruby -e "NSNumber.numberWithInt(42.0).intValue"
-e:1:in `<main>': undefined method `intValue' for #<NSCFNumber:0x1087490> (NoMethodError)

Second, calling #intValue on a NSCFNumber that was returned from the ObjC world crashes the interpreter

gdb --args ./miniruby -e "framework 'foundation'; p [1].objectAtIndex(0).intValue"
[...]
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000258
0x93d1e30b in _class_isMetaClass ()

Change History

Changed 10 months ago by lsansonetti@…

  • milestone set to MacRuby 1.0

Changed 10 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r72/trunk.

Changed 10 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby 0.1
Note: See TracTickets for help on using tickets.