Skip to content

Add more tests for superclass resolution behaviour#860

Open
amomchilov wants to merge 3 commits into
mainfrom
Alex/superclass-resolution-tests
Open

Add more tests for superclass resolution behaviour#860
amomchilov wants to merge 3 commits into
mainfrom
Alex/superclass-resolution-tests

Conversation

@amomchilov

@amomchilov amomchilov commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Documents existing behaviour as-is.

Adds some pending tests that will need to be fixed in the future for:

  1. Diagnose for contradictory superclasses on the same class #857
  2. Diagnose superclass set in one definition, after another definition left it implicit #858

@amomchilov amomchilov requested a review from a team as a code owner June 12, 2026 17:29
);
}

// Contrast with this case, which Ruby allows::

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is already encoded in the other tests, so I would remove it from this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which one? I don't see it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this not the same as C1 in superclass_is_load_order_independent? Also, I would split each thing into their own test rather than checking multiple things in each example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  1. It's exercising the same code, but it's making a different claim about it. I tried to explain it on the docs of this test:

    Unlike the superclass_is_load_order_independent() test which covers contradictions across files,
    contradictions within the same file are deterministically an issue.

  2. What I'm trying to emphasize here is the contrast that one order is deterministically always an issue, whereas the other order is deterministically always okay. And that it's not automatically an issue to not have the superclass clause repeated the same, but that the order is what matters (within the scope of a single file)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, that's fine. What do you think about splitting everything into separate examples though?

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.

2 participants