summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 08:27:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-23 08:27:06 +0000
commit333eb8380f00d50c3a1d4d86ada9cc4c879a4053 (patch)
tree65e40472106b90f927f2b3ef9e9928fc9c9e4a79
parent8637a41d2add02b92858073707070798841b1074 (diff)
* eval.c (rb_eval): do not warn discarding already undefined
method. * lib/rational.rb: undef quo before replacing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--eval.c2
-rw-r--r--lib/rational.rb4
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0674c3d16e..d57ad36655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jan 23 17:25:04 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_eval): do not warn discarding already undefined
+ method.
+
+ * lib/rational.rb: undef quo before replacing.
+
Thu Jan 23 15:49:57 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (arg): missing arguments.
diff --git a/eval.c b/eval.c
index 171eadf0f1..6fcfdb0d56 100644
--- a/eval.c
+++ b/eval.c
@@ -3203,7 +3203,7 @@ rb_eval(self, n)
rb_frozen_class_p(ruby_class);
body = search_method(ruby_class, node->nd_mid, &origin);
if (body){
- if (RTEST(ruby_verbose) && ruby_class == origin && body->nd_cnt == 0) {
+ if (RTEST(ruby_verbose) && ruby_class == origin && body->nd_cnt == 0 && body->nd_body) {
rb_warning("method redefined; discarding old %s", rb_id2name(node->nd_mid));
}
}
diff --git a/lib/rational.rb b/lib/rational.rb
index af4eada071..1e41b9a28a 100644
--- a/lib/rational.rb
+++ b/lib/rational.rb
@@ -317,6 +317,7 @@ class Fixnum
alias power! **;
end
+ undef quo
def quo(other)
Rational.new!(self,1) / other
end
@@ -339,7 +340,8 @@ class Bignum
if not defined? power!
alias power! **
end
-
+
+ undef quo
def quo(other)
Rational.new!(self,1) / other
end