Skip to content

Fix #10781#10782

Merged
Octachron merged 3 commits intoocaml:trunkfrom
lpw25:fix-10781
Dec 14, 2021
Merged

Fix #10781#10782
Octachron merged 3 commits intoocaml:trunkfrom
lpw25:fix-10781

Conversation

@lpw25
Copy link
Copy Markdown
Contributor

@lpw25 lpw25 commented Nov 18, 2021

Fixes #10781 by updating the associated row_field when a private method is overridden with a public method. This requires tracking these row_fields in csig_meths.

| Mprivate k ->
match priv with
| Public ->
link_kind ~inside:k field_public;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can raise an Invalid_argument exception inside link_kind if the same method is added multiple times. For example, this crashes the toplevel

class foo =
  object
    method private f (b : bool) = b
    inherit object
      method f (b : bool) = b
    end
  end;;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[4.14] Overridden methods keep their inherited attributes

4 participants