Skip to content

Commit 5ea3fec

Browse files
committed
add description about overridden methods
1 parent b98fd73 commit 5ea3fec

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

doc/4_godelscript_language.en.md

+1
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ schema MyFile extends File {}
686686
##### Method Override
687687

688688
If the subclass implementation contains a method with the same name as the parent class, the parent method will be **overridden** by the subclass method.
689+
The overridden method can use different parameter and return type. There's no need to use the same parameter and return type of parent class method.
689690

690691
```rust
691692
schema File {

doc/4_godelscript_language.md

+1
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,7 @@ schema MyFile extends File {}
686686
##### Method Override
687687

688688
如果子类的实现中存在与父类同名的方法,则父类的方法会被子类方法**覆盖**
689+
覆盖方法的参数和返回值类型没有限制,不需要与父类保持一致。
689690

690691
```rust
691692
schema File {

0 commit comments

Comments
 (0)