diff --git a/src/doc/commands/commands_usage.nit b/src/doc/commands/commands_usage.nit index 82e26ee18f..701343f93b 100644 --- a/src/doc/commands/commands_usage.nit +++ b/src/doc/commands/commands_usage.nit @@ -199,7 +199,9 @@ private class MPropertyCallVisitor do node.visit_all(self) if not node isa ASendExpr then return - calls.add node.callsite.as(not null).mproperty + var callsite = node.callsite + if callsite == null then return + calls.add callsite.mproperty end end diff --git a/src/doc/term/term.nit b/src/doc/term/term.nit index 7d490e44d5..a909d232a4 100644 --- a/src/doc/term/term.nit +++ b/src/doc/term/term.nit @@ -36,7 +36,7 @@ redef class CommandParser error.print_message(no_color) print "" end - if cmd == null then return + if cmd == null or error isa CmdError then return cmd.execute(no_color) end end diff --git a/tests/nitx.args b/tests/nitx.args index 3bc599de25..3ec9c57fc0 100644 --- a/tests/nitx.args +++ b/tests/nitx.args @@ -1,3 +1,5 @@ base_simple3.nit -c A --no-color base_simple3.nit -c foo --no-color base_simple3.nit -c "defs: base_simple3::base_simple3" --no-color +base_simple3.nit -c "lin: NotAnEntity" --no-color +nitx_annotation_args.nit -I ../lib/core -c "call: nitx_annotation_args::A::foo" --no-color diff --git a/tests/nitx_annotation_args.nit b/tests/nitx_annotation_args.nit new file mode 100644 index 0000000000..cb73688264 --- /dev/null +++ b/tests/nitx_annotation_args.nit @@ -0,0 +1,30 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +module nitx_annotation_args + +import kernel + +class A + autoinit y + + var x = 0 is writable(set_x) + + var y: Int + + fun foo do end +end + +var a = new A(1) +a.foo diff --git a/tests/sav/nitx_args4.res b/tests/sav/nitx_args4.res new file mode 100644 index 0000000000..c6ea93362c --- /dev/null +++ b/tests/sav/nitx_args4.res @@ -0,0 +1,4 @@ + +No result found for `NotAnEntity`... + + diff --git a/tests/sav/nitx_args5.res b/tests/sav/nitx_args5.res new file mode 100644 index 0000000000..2602b1024e --- /dev/null +++ b/tests/sav/nitx_args5.res @@ -0,0 +1,8 @@ + +Methods calling `nitx_annotation_args::A::foo`: + + * nitx_annotation_args::nitx_annotation_args$core::Sys$main + # The main method of a program. + redef fun main + nitx_annotation_args.nit:29,1--30,5 +