diff --git a/ets2panda/test/runtime/ets/override_field_tests/override_field_test.ets b/ets2panda/test/runtime/ets/override_field_tests/override_field_test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7a50e6476d93bec300864fbf97dc0e599b3f2559 --- /dev/null +++ b/ets2panda/test/runtime/ets/override_field_tests/override_field_test.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * 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. + */ + +class Base1{ + field : number = this.init_in_base() + private init_in_base() { + return 123; + } +} + +interface Base2 { + field : number +} + +class Base3 extends Base1 { + override field: number = 345; +} + + +class Derived extends Base3 implements Base2 { + field:number = this.init_in_derived() + + private init_in_derived() { + return 456; + } +} + +function main() +{ + let derived = new Derived(); +} \ No newline at end of file