Skip to content

Ensure associativity error in type operators doesn't crash#3337

Merged
garyb merged 1 commit intopurescript:masterfrom
garyb:3335-typeop-assoc-error
Apr 28, 2018
Merged

Ensure associativity error in type operators doesn't crash#3337
garyb merged 1 commit intopurescript:masterfrom
garyb:3335-typeop-assoc-error

Conversation

@garyb
Copy link
Copy Markdown
Member

@garyb garyb commented Apr 28, 2018

Resolves #3335

This uses the whole type annotation for the span (or whatever enclosing source span it has on hand) since we don't have any position information in types. It's still decent though:

[1/1 NonAssociativeError] src\3335-TypeOpAssociativityError.purs:6:1

  6  const :: forall a b. a >> b >> a
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Cannot parse an expression that uses multiple instances of the non-associative operator Main.(>>).
  Use parentheses to resolve this ambiguity.

@garyb garyb merged commit 4c8f5f4 into purescript:master Apr 28, 2018
@garyb garyb deleted the 3335-typeop-assoc-error branch April 28, 2018 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash "tried to use type operator source span"

2 participants