Projects

Ticket #97 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

A selector cannot be nil

Reported by: vincent.isambart@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.3
Component: MacRuby Keywords:
Cc:

Description

In Objectve-C a selector can be nil, for example the following code is correct:

NSMenuItem *dummyItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];

but in MacRuby we get an error:

% macruby -e "framework 'Cocoa'; NSMenuItem.alloc.initWithTitle('', action:nil, keyEquivalent:'')"
-e:1:in `initWithTitle:action:keyEquivalent:': can't convert Ruby object `nil' to Objective-C value of type `:' (ArgumentError)
     from -e:1:in `<main>'

So I think MacRuby should support conversion from nil for selectors.

Change History

Changed 4 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.3

Fixed by r338/trunk.

Note: See TracTickets for help on using tickets.