Projects

Ticket #651 (closed defect: fixed)

Opened 22 months ago

Last modified 22 months ago

NSString#stringByDeletingPathExtension: not returning a String

Reported by: koudelka@… Owned by: lsansonetti@…
Priority: minor Milestone: MacRuby 0.6
Component: MacRuby Keywords: stringByDeletingPathExtension
Cc:

Description

The NSString docs for stringByDeletingPathExtension: indicate that it should return an NSString pointer, but doesn't seem to do so in macruby.

In macirb:

"/a/b/c.d".stringByDeletingPathExtension => "/a/b/c"

"/a/b/c.d".stringByDeletingPathExtension + 'aa'

TypeError: wrong argument type NSPathStore2 (expected String)

from (irb):2:in `<main>'

"/a/b/c.d".stringByDeletingPathExtension.class => NSPathStore2

My macruby version string is: MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

--Mike

Change History

Changed 22 months ago by koudelka@…

Sorry, that should be "returning" in the title, obviously. :)

Changed 22 months ago by lsansonetti@…

  • summary changed from NSString#stringByDeletingPathExtension: not retuning a String to NSString#stringByDeletingPathExtension: not returning a String

It behaves like in Objective-C. NSPathStore2 is a subclass of NSString. The fact that #+ does not work on it is still a problem, though.

Changed 22 months ago by martinlagardette@…

I failed to reproduce the bug with MacRuby trunk:

$> macirb
irb(main):001:0> "/a/b/c.d".stringByDeletingPathExtension
=> "/a/b/c"
irb(main):002:0> "/a/b/c.d".stringByDeletingPathExtension + 'aa'
=> "/a/b/caa"
irb(main):003:0> "/a/b/c.d".stringByDeletingPathExtension.class
=> String

Changed 22 months ago by martinlagardette@…

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

Closing as fixed. Please check with trunk/nightlies, it should be fixed for you too :-)

Note: See TracTickets for help on using tickets.