end
j += 1
end
- var stop_prop: MMMethod
+ var stop_prop: MMMethod = null
if j < n.explicit_super_init_calls.length then
stop_prop = n.explicit_super_init_calls[j]
end
end
end
-redef class MMSrcLocalProperty
+redef class MMConcreteProperty
# Compile the property as a C property
meth compile_property_to_c(v: CompilerVisitor) do end
end
protected meth decl_csignature(v: CompilerVisitor, args: Array[String]): String
do
var params = new Array[String]
- var params_new: Array[String]
+ var params_new: Array[String] = null
if global.is_init then
params_new = new Array[String]
end
redef meth do_compile_inside(v, method, params)
do
var orig_meth: MMLocalProperty = method.global.intro
- var orig_sig = orig_meth.signature.adaptation_to(method.signature.recv)
+ var orig_sig = orig_meth.signature_for(method.signature.recv)
if n_signature != null then
var sig = n_signature
assert sig isa ASignature
var old_return_value = v.return_value
var old_has_return = v.has_return
- var itpos: String
+ var itpos: String = null
if self isa AConcreteInitPropdef then
itpos = "VAL2OBJ({params[0]})->vft[{method.local_class.global.init_table_pos_id}].i"
# v.add_instr("printf(\"{method.full_name}: inittable[%d] = %d\\n\", {itpos}, init_table[{itpos}]);")
do
var c = method.local_class.name
var n = method.name
- var s: String
+ var s: String = null
if c == once "Int".to_symbol then
if n == once "object_id".to_symbol then
s = "{p[0]}"
end
else if c == once "Float".to_symbol then
if n == once "object_id".to_symbol then
- s = "TAG_Int((int)UNBOX_Float({p[0]}))"
+ s = "TAG_Int((bigint)UNBOX_Float({p[0]}))"
else if n == once "unary -".to_symbol then
s = "BOX_Float(-UNBOX_Float({p[0]}))"
else if n == once "output".to_symbol then
v.add_instr("printf(\"%f\\n\", UNBOX_Float({p[0]}));")
else if n == once "to_i".to_symbol then
- s = "TAG_Int((int)UNBOX_Float({p[0]}))"
+ s = "TAG_Int((bigint)UNBOX_Float({p[0]}))"
else if n == once "+".to_symbol then
s = "BOX_Float(UNBOX_Float({p[0]})+UNBOX_Float({p[1]}))"
else if n == once "-".to_symbol then
v.add_instr("(void)memcpy(UNBOX_NativeString({p[1]})+UNTAG_Int({p[4]}), UNBOX_NativeString({p[0]})+UNTAG_Int({p[3]}), UNTAG_Int({p[2]}));")
end
else if n == once "object_id".to_symbol then
- s = "TAG_Int((int){p[0]})"
+ s = "TAG_Int((bigint){p[0]})"
else if n == once "sys".to_symbol then
s = "(G_sys)"
else if n == once "is_same_type".to_symbol then
end
end
+redef class AAsCastExpr
+ redef meth compile_expr(v)
+ do
+ var e = v.compile_expr(n_expr)
+ n_type.stype.compile_type_check(v, e, self)
+ return e
+ end
+end
+
redef class ATrueExpr
redef meth compile_expr(v)
do