Permalink
Browse files

Symbol#dup raises a TypeError

  • Loading branch information...
1 parent 3a8540a commit 31468041b081eef4e5fad6cbe7388f49bde9d16c @Watson1978 Watson1978 committed Jun 22, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −0 NSString.m
  2. +0 −1 spec/frozen/tags/macruby/core/object/dup_tags.txt
View
@@ -55,6 +55,10 @@
static id
nsstr_dup(id rcv, SEL sel)
{
+ if (TYPE(rcv) == T_SYMBOL) {
+ rb_raise(rb_eTypeError, "can't dup %s", rb_obj_classname((VALUE)rcv));
+ }
+
id dup = (id)str_new_from_cfstring((CFStringRef)rcv);
if (OBJ_TAINTED(rcv)) {
OBJ_TAINT(dup);
@@ -1 +0,0 @@
-fails:Object#dup raises a TypeError for Symbol

0 comments on commit 3146804

Please sign in to comment.