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

Allow overridable method delegation in downstream CompilerOpts implementations #85

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

prozacchiwawa
Copy link
Contributor

This adds an interposer which allows a CompilerOpts to be implemented as a wrapper around an existing CompilerOpts object and allows the user simultaneously to provide individual method overrides only where desired. This allows the interface for CompilerOpts to grow and change without imposing as much on downstream implementations. CompilerOpts provides file reading (and writing and file dates in the module system pr) which are used to delegate these functions in uncommon scenarios such as when we want to test how the compiler reacts to the presence or absence of files, or collect multiple outputs without writing to disk. The HasCompilerOptsDelegation trait has methods which provide default implementations for every method of CompilerOpts, but which the user can replace when they implement HasCompilerOptsDelegation. Having HasCompilerOptsDelegation automatically gives one a trait implementation for CompilerOpts which uses those overrides.

@coveralls
Copy link

coveralls commented Apr 23, 2024

Pull Request Test Coverage Report for Build 8820477360

Details

  • 108 of 174 (62.07%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 82.812%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/compiler/comptypes.rs 108 174 62.07%
Files with Coverage Reduction New Missed Lines %
src/compiler/sexp.rs 1 80.73%
Totals Coverage Status
Change from base Build 8805170223: -0.2%
Covered Lines: 15047
Relevant Lines: 18170

💛 - Coveralls

@prozacchiwawa prozacchiwawa merged commit 78e8362 into base Apr 25, 2024
29 checks passed
@prozacchiwawa prozacchiwawa deleted the 20240423-compiler-opts-delegation branch April 25, 2024 15:35
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.

3 participants