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

Properly implement import public. #329

Merged
merged 4 commits into from
Aug 28, 2019
Merged

Properly implement import public. #329

merged 4 commits into from
Aug 28, 2019

Commits on Aug 27, 2019

  1. Properly implement import public.

    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.
    judah committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    e745a02 View commit details
    Browse the repository at this point in the history
  2. Update the changelog.

    judah committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    66ede81 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2019

  1. Add back old test cases

    judah committed Aug 28, 2019
    Configuration menu
    Copy the full SHA
    75effda View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d6b0ffa View commit details
    Browse the repository at this point in the history