Commit dda7d424 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Minor OOP fixes



Change-Id: If4373d02526f3b377b46828ba8e49bcd1e273ab8
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent a31e17c0
......@@ -1418,7 +1418,9 @@ namespace Ttcn {
Common::Assignment *RunsOnScope::get_ass_bySRef(Ref_simple *p_ref)
{
if (!p_ref) FATAL_ERROR("Ttcn::RunsOnScope::get_ass_bySRef()");
if (p_ref->get_modid()) return parent_scope->get_ass_bySRef(p_ref);
if (p_ref->get_modid() || p_ref->get_reftype() != Ref_simple::REF_BASIC) {
return parent_scope->get_ass_bySRef(p_ref);
}
else {
const Identifier& id = *p_ref->get_id();
if (component_defs->has_local_ass_withId(id)) {
......@@ -3667,12 +3669,6 @@ namespace Ttcn {
delete t;
continue;
}
else if (t->get_type_refd_last()->get_typetype() == Type::T_CLASS) {
ea.error("Class type `%s' cannot be added to the anytype",
t->get_typename().c_str());
delete t;
continue;
}
string field_name;
const char* btn = Type::get_typename_builtin(t->get_typetype());
......@@ -4206,6 +4202,10 @@ namespace Ttcn {
error("Type of module parameter cannot be signature `%s'",
t->get_fullname().c_str());
break;
case Type::T_CLASS:
error("Type of module parameter cannot be or embed class type `%s'",
t->get_fullname().c_str());
break;
case Type::T_FUNCTION:
case Type::T_ALTSTEP:
case Type::T_TESTCASE:
......@@ -4214,10 +4214,6 @@ namespace Ttcn {
" `%s' which has runs on self clause", t->get_fullname().c_str());
break;
}
case Type::T_CLASS:
error("Type of module parameter cannot be or embed class type `%s'",
t->get_fullname().c_str());
break;
default:
#if defined(MINGW)
checked = true;
......
......@@ -16,7 +16,7 @@ include ../../Makefile.personal
SADIRS := ver param template any_from pattern_ref float recof_index \
port_translation mtc_and_system_clause port_map_connect deterministic invoking_function_from_specific_places \
json realtime map_param
json realtime map_param oop
ifdef RT2
SADIRS += deprecated erroneous_attributes template_concat
endif
......
......@@ -159,7 +159,7 @@ function f_embedded_types() { //^In function definition//
var SetOfClass v_setof := { C0.create };
var UniClass v_uni := { x := C0.create };
var anytype v_any; //^In variable definition// //^In type definition//
v_any.C0 := C0.create; //^In variable assignment// //Reference to non-existent field `C0' in type `@oop_SE.anytype'//
v_any.C0 := C0.create;
}
......@@ -213,5 +213,5 @@ type class C10 runs on CT_RunsOn mtc CT_Mtc system CT_System { //^In type defini
}
with {
extension "anytype C0" //Class type `@oop_SE.C0' cannot be added to the anytype//
extension "anytype C0" //^In anytype field// //Class type `@oop_SE.C0' cannot be embedded into another type//
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment