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

Overlapping structure sources should not be considered right-to-left #6059

Closed
Kha opened this issue Nov 13, 2024 · 1 comment
Closed

Overlapping structure sources should not be considered right-to-left #6059

Kha opened this issue Nov 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Kha
Copy link
Member

Kha commented Nov 13, 2024

Consider the following structure updates:

structure A where
  an : Nat

structure B extends A where
  bn : Nat

def a : A := { an := 0 }
def b : B := { an := 1, bn := 1 }

example : { a, b with }.an = 0 := rfl
example : { b, a with }.an = 0 := rfl

The first example succeeds while the second one doesn't. I would have expected exactly the opposite and was very confused when that didn't happen.

@Kha Kha added the bug Something isn't working label Nov 13, 2024
@Kha
Copy link
Member Author

Kha commented Nov 15, 2024

This is likely working as expected; one should always prefer direct field access via to* if one cares about ordering, sharing, etc.

@Kha Kha closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant