-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly implement
import public
. (#329)
Fixes #19. After this change, if `bar.proto` contains the line import public foo.proto Then it turns into ``` module Proto.Bar(..., module Proto.Foo) where import Proto.Foo -- unqualified, to allow the reexport of its definitions ``` The previous hacky approach was: `Proto.Bar` doesn't reexport `Proto.Foo`; instead, if another file `baz.proto` imports `bar.proto`, *then* the codegen of `Proto.Baz` imports `Proto.Foo` as well as `Proto.Bar`. This approach let us avoid module-level exports, but had two limitations: 1) It violated the principle of "strict dependencies", since `Proto.Baz` is importing what is essentially a transitive dependency. 2) Non-codegen modules that import a proto module can't benefit from `import public` statements.
- Loading branch information
Showing
7 changed files
with
72 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters