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

feat: make dot notation be affected by export/open #6189

Merged
merged 2 commits into from
Nov 25, 2024

Commits on Nov 23, 2024

  1. feat: dot notation improvements

    This PR changes how generalized field notation ("dot notation") resolves the name of the function, adds a feature where terms such as `x.toString` can resolve as `toString x` as a last resort, and modifies the `Function` dot notation to always use the first explicit argument rather than the first function argument. The new rule is that if `x : S`, then `x.f` resolves the name `S.f` relative to the root namespace (hence it now responds to `export` and `open). Breaking change: aliases now resolve differently. Before, if `x : S`, and `S.f` is an alias for `S'.f`, then `x.f` would use `S'.f` and look for an argument of type `S'`. Now, it looks for an argument of type `S`, which is more generally useful behavior. Code making use of the old behavior should consider defining `S` or `S'` in terms of the other, since dot notation can unfold definitions during resolution.
    
    This also fixes a bug in explicit field notation (`@x.f`) where `x` could be passed as the wrong argument.
    
    Closes leanprover#3031
    kmill committed Nov 23, 2024
    Configuration menu
    Copy the full SHA
    fa36ca0 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2024

  1. Configuration menu
    Copy the full SHA
    fb9e47f View commit details
    Browse the repository at this point in the history