Skip to content

[New module system] Fixity rebalancing broken #1371

@m-yac

Description

@m-yac

In #1363 tests/regression/repl-decls.icry fails because:

let x -<- y = x - y; infixl 5 -<-; let (-<-) : Integer -> Integer -> Integer
let x ->- y = x - y; infixr 5 ->-; let (->-) : Integer -> Integer -> Integer

42 -<- 10 -<- 100
42 ->- 10 ->- 100
42 ->- 10 -<- 100

outputs

-68
-68
-68

instead of what is used to, which was:

-68
132

[error] at repl-decls.icry:6:4--6:7 and repl-decls.icry:6:11--6:14
    The fixities of
      • (->-) (precedence 5, right-associative)
      • (-<-) (precedence 5, left-associative)
    are not compatible.
    You may use explicit parentheses to disambiguate.

After a quick first pass through the renamer, I saw no reason why this PR would break the existing fixity rebalancing (none of the relevant bits seem to be changed) – but I'll be taking a deeper look soon.

Metadata

Metadata

Assignees

Labels

languageChanges or extensions to the languageparameterized modulesRelated to Cryptol's parameterized modules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions