diff --git a/compiler2/Type.cc b/compiler2/Type.cc index ffeee7778458aded93c9131e791ce1a433697134..1972378081b2b485788606fd7f708649bba7aad0 100644 --- a/compiler2/Type.cc +++ b/compiler2/Type.cc @@ -5467,9 +5467,11 @@ namespace Common { case T_FUNCTION: case T_ALTSTEP: case T_TESTCASE: - case T_CLASS: // user-defined structured types must be identical return t1 == t2; + case T_CLASS: + return t1 == t2 || (t2->typetype == T_CLASS && + t2->u.class_->is_built_in() && t1->u.class_->is_built_in()); case T_ARRAY: // the embedded type and the dimension must be identical in case of arrays return t2->typetype == T_ARRAY && diff --git a/function_test/Semantic_Analyser/oop/oop_SE.ttcn b/function_test/Semantic_Analyser/oop/oop_SE.ttcn index c12cc587f68ba83705557a60eb5a68e4c3bfb104..b65e959c994806b78a7a6d04bc1b632b1a474f73 100644 --- a/function_test/Semantic_Analyser/oop/oop_SE.ttcn +++ b/function_test/Semantic_Analyser/oop/oop_SE.ttcn @@ -381,8 +381,16 @@ type class C34 extends C25 { //^In type definition// public function f_abs(inout template integer p) return boolean { return false; } //The prototype of method `f_abs' is not identical to that of inherited abstract method `@oop_SE.C25.f_abs'// } +type class @abstract C35 { + public function @abstract f(in object p) return object; +} + +type class C36 extends C35 { + public function f(in object p) return object { return p; } +} + -type class C35 { +type class C37 { public const integer c := 3; public template charstring t := ""; public function f1() return Rec { return { 2, "a" }; } @@ -391,12 +399,12 @@ type class C35 { } function f_left_hand_side() { //^In function definition// - var C35 x := C35.create; - x.c := 2; //^In variable assignment// //Reference to a variable or template variable was expected instead of constant `@oop_SE.C35.c'// - x.t := *; //^In variable assignment// //Reference to a variable or template variable was expected instead of template `@oop_SE.C35.t'// - x.f1() := { 3, "b" }; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C35.f1'// - x.f1().num := 3; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C35.f1'// - x.f2() := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C35.f2'// + var C37 x := C37.create; + x.c := 2; //^In variable assignment// //Reference to a variable or template variable was expected instead of constant `@oop_SE.C37.c'// + x.t := *; //^In variable assignment// //Reference to a variable or template variable was expected instead of template `@oop_SE.C37.t'// + x.f1() := { 3, "b" }; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C37.f1'// + x.f1().num := 3; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C37.f1'// + x.f2() := "x"; //^In variable assignment// //Reference to a variable or template variable was expected instead of function `@oop_SE.C37.f2'// }