mruby-io does not provide to_path method for implicit conversion

mruby does not use implicit type conversion by `to_xxx` (e.g. to_int,
to_str, etc.)
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-02-24 14:01:02 +09:00
parent d7f4af04ca
commit d86c4a795d
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ Add the line below to your build configuration.
| File#flock | o | |
| File#lstat | | |
| File#mtime | | |
| File#path, File#to_path | o | |
| File#path | o | |
| File#size | | |
| File#truncate | | |
-2
View File
@@ -199,8 +199,6 @@ class File < IO
def self.path(filename)
if filename.kind_of?(String)
filename
elsif filename.respond_to?(:to_path)
filename.to_path
else
raise TypeError, "no implicit conversion of #{filename.class} into String"
end