Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First draft of an update to the Overloads chapter (DRAFT: DO NOT MERGE) #1839

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

erictraut
Copy link
Collaborator

  • Attempts to clearly define the algorithm for overload matching.
  • Describes checks for overload consistency, overlapping overloads, and implementation consistency.

erictraut and others added 2 commits August 13, 2024 17:06
* Attempts to clearly define the algorithm for overload matching.
* Describes checks for overload consistency, overlapping overloads, and implementation consistency.
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

(two quick comments)

docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Show resolved Hide resolved
docs/spec/overload.rst Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
Copy link
Member

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Thanks for working on this tricky area! I haven't finished review yet, but may be called away soon, so I'm submitting the comments I have so far. (EDIT: I've now completed my review.)

docs/spec/overload.rst Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
docs/spec/overload.rst Outdated Show resolved Hide resolved
@erictraut
Copy link
Collaborator Author

erictraut commented Aug 28, 2024

We typically wait for a proposed spec change to be accepted by the TC prior to writing conformance tests. In this case, I think it's advisable to write the conformance tests prior to acceptance. This will help us validate the proposed spec changes and tell us if (and to what extent) these changes will be disruptive for existing stubs and current type checker implementations.

I would normally volunteer to write the conformance tests, but in this case I think it would be preferable for someone else to write the tests based on their reading of the spec update. If I write the tests, there's a real possibility that they will match what's in my head but not accurately reflect the letter of the spec. There's also a possibility that I'll miss some important cases in the tests. If someone else writes the tests, they can help identify holes and ambiguities in the spec language.

Is there anyone willing to volunteer to write a draft set of conformance tests for this overload functionality? I'm thinking that there should be four new test files:

  1. overloads_definitions: Tests the rules defined in the "Invalid overload definitions" section
  2. overloads_consistency: Tests the rules defined in the "Implementation consistency" section
  3. overloads_overlap: Tests the rules defined in the "Overlapping overloads" section
  4. overloads_evaluation: Tests the rules defined in the "Overload call evaluation" section

If this is more work than any one person wants to volunteer for, we could split it up.

@carljm
Copy link
Member

carljm commented Aug 28, 2024

I am willing to work on conformance tests for this, but I probably can't get to it until the core dev sprint, Sept 23-27. I realize that implies a delay to moving forward with this PR. Happy for someone else to get to it first.

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.

8 participants