Allow overridable method delegation in downstream CompilerOpts implementations #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.