Skip to content

Conversation

@saem
Copy link
Collaborator

@saem saem commented Feb 25, 2024

Summary

  • created a battery of tests specifying vararg parameters and to a lesser extent the pragma
  • updated the implementation for varargs argument and parameter handling to conform to the aforementioned tests
  • updated the docs to describe the latest behaviour and indicate future direction

Details

  • info that couldn't fit into the summary
  • relevant details; tricky parts
  • anything else

Notes for Reviewers

  • the plan for this PR is to merge in tests and the rework of sigmatch in one go
    • reason for doing both simultaneously is because the spec itself needs to be vetted through implementing
  • created initial as a non-draft PR to ensure the existing tests/knownIssues are at least green in CI
  • rough plan, in case you have feedback on the approach:
    • get initial tests in place
    • add docs to tests clarifying the intention from the notes remaining in tvarargs
    • initial revision of docs (manual.rst) to indicate new behaviour and future direction
    • rewrite sigmatch.matchesAux which contains the parameter handling
      - [ ] any related updates/changes
    • write a proper PR title and message

@saem saem added spec Specification tests edit or formal specification required. test Add or improve tests compiler/sem Related to semantic-analysis system of the compiler language-design Language design syntax, semantics, types, statics and dynamics. labels Feb 25, 2024
saem added 20 commits May 3, 2025 11:24
- parameter passing
- typed ast construction
also rename/relocate tests to more appropriate location
- use blocks to document each test
- reorder and group tests more logically
- note tests that should work with `knownIssue` comments
- sketch of all missing tests identified thus far
- plan for test coverage
- inventory of existing tests
- document questions and answers for future and current direction

This will be used to create the initial test spec for varargs.
- relatively fine grained split of knownIssues for easier fixing
- cross-reference knownIssues between parent and knownIssue tests
- remove corresponding sketch tests from `tvarargs`
- disable `tvarargs` so the `lang_callable/varags` category can be run
remove corresponding tests from tvarargs.
until it's fixed going to be marking lots of tests as known issue
- ensure varargs parameter is inferrable
- add tests to disallow type parameter being set to varargs
@saem
Copy link
Collaborator Author

saem commented Jun 19, 2025

One of the things blocking this PR is that the core matchesAux loop needs to work on a per formal parameter basis instead of per argument as it is now. This allows for the progress of matching against formals to be controlled more precisely.

As part of that I believe one of the things that needs to happen is to move default parameter handling/setting to happen in matchesAux as well, instead of in matches, and possibly matchesGenericParams.

@saem saem force-pushed the saem-spec-specify-varargs branch from 4447e88 to 5808ef6 Compare September 27, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/sem Related to semantic-analysis system of the compiler language-design Language design syntax, semantics, types, statics and dynamics. spec Specification tests edit or formal specification required. test Add or improve tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant