Skip to content

Commit

Permalink
add description about overridden methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ValKmjolnir committed May 15, 2024
1 parent b98fd73 commit 5ea3fec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/4_godelscript_language.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ schema MyFile extends File {}
##### Method Override

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.
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.

```rust
schema File {
Expand Down
1 change: 1 addition & 0 deletions doc/4_godelscript_language.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ schema MyFile extends File {}
##### Method Override

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

```rust
schema File {
Expand Down

0 comments on commit 5ea3fec

Please sign in to comment.