From 76355dee686254dcf51fcd42fbe13c8f00c3aa95 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 14 Sep 2019 23:20:57 +0900 Subject: Add unavailability of declaration form of visibility methods; #4708 --- doc/limitations.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/limitations.md b/doc/limitations.md index e6f40a942..6958d396f 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -96,7 +96,7 @@ p Liste.new "foobar" ## Method visibility For simplicity reasons no method visibility (public/private/protected) is -supported. +supported. Those methods are defined but they are dummy methods. ```ruby class VisibleTest @@ -126,6 +126,42 @@ true true ``` +### Visibility Declaration + +The declaration form of following visibility methods are not implemented. + +* `public` +* `private` +* `protected` +* `module_function` + +Especially, `module_function` method is not dummy, but no declaration form. + +``` +module TestModule + module_function + def test_func + p 'test_func called' + end + + test_func +end + +p 'ok' +``` + +#### Ruby [ruby 2.5.5p157 (2019-03-15 revision 67260)] + +``` +ok +``` + +#### mruby [2.0.1 (2019-4-4)] + +``` +test.rb:8: undefined method 'test_func' (NoMethodError) +``` + ## `defined?` The `defined?` keyword is considered too complex to be fully -- cgit v1.2.3