if compiler.modelbuilder.toolcontext.opt_invocation_metrics.value then add("count_invoke_by_tables++;")
assert arguments.length == mmethod.intro.msignature.arity + 1 else debug("Invalid arity for {mmethod}. {arguments.length} arguments given.")
- var recv = arguments.first
var res0 = before_send(mmethod, arguments)
var runtime_function = mmethod.intro.virtual_runtime_function
var msignature = runtime_function.called_signature
+ adapt_signature(mmethod.intro, arguments)
+
var res: nullable RuntimeVariable
var ret = msignature.return_mtype
if ret == null then
res = self.new_var(ret)
end
- var ss = new FlatBuffer
-
- ss.append("{recv}")
- for i in [0..msignature.arity[ do
- var a = arguments[i+1]
- var t = msignature.mparameters[i].mtype
- if i == msignature.vararg_rank then
- t = arguments[i+1].mcasttype
- end
- a = self.autobox(a, t)
- ss.append(", {a}")
- end
+ var ss = arguments.join(", ")
var const_color = mentity.const_color
var ress
--- /dev/null
+# 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.
+
+import standard::kernel
+
+
+redef class Int
+ fun foo do self.output
+end
+
+fun bar(i: nullable Int) do i.foo
+
+redef class Float
+ fun foo do self.output
+end
+
+fun baz(i: nullable Float) do i.foo
+
+bar(1)
+baz(1.0)
+
+var a: nullable Object
+
+a = 1
+a.foo
+
+a = 1.0
+a.foo