-
Notifications
You must be signed in to change notification settings - Fork 211
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
Union Access #657
Union Access #657
Conversation
@FintanH there is some info about how tests are structured in dhall-lang/dhall-lang#240. |
@f-f have I told you you're a hero? Thank you. I think I can see what's going on now :) |
Is there something I have to do when adding new files? It seems the tests couldn't find the new files, but I added them :/ |
@f-f ahhh of course 😅 |
src/Dhall/TypeCheck.hs
Outdated
@@ -3273,22 +3293,70 @@ prettyTypeMessage (NotARecord lazyText0 expr0 expr1) = ErrorMessages {..} | |||
\ Invalid: Not a record \n\ | |||
\ \n\ | |||
\ \n\ | |||
\────────────────────────────────────────────────────────────────────────────────\n\ | |||
\ \n\ | |||
\You tried to access the field:aaa \n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\You tried to access the field:aaa \n\ | |
\You tried to access the field: \n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hahaha whooops!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
Let's also add some typecheck
tests, since we're adding code paths in there as well
@f-f Ya I thought about that, but didn't see any existing ones that had similar functionality. But that's a bad excuse really 😳 |
src/Dhall/TypeCheck.hs
Outdated
\ \n\ | ||
\ ┌───────────────────────────────────────────┐ \n\ | ||
\ │ λ(r : { foo : Bool, bar : Text , baz : Natural }) → r.{ foo, bar } │ ... and so is this \n\ | ||
\ └───────────────────────────────────────────┘ \n\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this boxing correct? It doesn't render correctly, but that could be my browser (I use a font with ligatures that might be messing things up, though everything else looks correct.
Addressing phase 1 of dhall-lang/dhall-lang#244 and #635
@Gabriel439: I haven't implemented any tests for this and I should but is there documentation of how the tests are laid out? I'm slightly confused but possibly it'd be fine if I spent some more time looking through them :)