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

Pretty printing of Absyn in error message does not respect fixity #177

Closed
1 of 5 tasks
JohnReppy opened this issue Jul 15, 2022 · 1 comment
Closed
1 of 5 tasks
Assignees
Labels
bug Something isn't working compiler problem with compiler fixed-in-110.99.3 issues that will be fixed in the 110.99.3 version gforge bug (or feature request) ported from smlnj-gforge repository

Comments

@JohnReppy
Copy link
Contributor

JohnReppy commented Jul 15, 2022

Version

110.82

Operating System

  • All
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

No response

Processor

Any

Component

Core system

Severity

Cosmetic

Description of the problem

The error message prints '::' as a prefix operator, instead of as an infix operator. This behavior is a regression, since previous versions got it right (see tests/bugs/outputs/bug0027.out for example).

Transcript

Standard ML of New Jersey v110.82 [built: Sat Oct 14 13:08:58 2017]
- fun f [] = 0
=   | f (x::xs) y = 1;
stdIn:1.6-2.20 Error: clauses don't all have same number of patterns
stdIn:1.6-2.20 Error: parameter or result constraints of clauses don't agree [tycon mismatch]
  this clause:      'Z list * 'Y -> 'X
  previous clauses:      'W list -> 'X
  in declaration:
    f = (fn nil => 0
          | (:: <pat>,y) => 1)

Expected Behavior

No response

Steps to Reproduce

fun f [] = 0
    | f (x::xs) y = 1;

Additional Information

No response

Email address

No response

Comments from smlnj-gforge

Original smlnj-gforge bug number 204

Submitted on 2018-05-19 at 14:37:00

Keywords: Pretty printing

@JohnReppy JohnReppy added bug Something isn't working compiler problem with compiler gforge bug (or feature request) ported from smlnj-gforge repository labels Jul 15, 2022
@dmacqueen dmacqueen added the fixed-in-110.99.3 issues that will be fixed in the 110.99.3 version label Jul 22, 2022
@dmacqueen
Copy link
Contributor

Fixed in 110.99.3. The problem was in ElabData/syntax/ppabsyn.sml, function ppDconPat, where in the APPpat case, the argument of the APPpat was not "stripped" to remove MARKpat (or CONSTRAINEDpat). Added/moved the required stripping functions (headStripExp and headStripPat) to ElabData/syntax/absynutil.sml and cleaned up a couple of debugging/printing flags by moving them to ElabData/main/edcontrol.*.

dmacqueen added a commit that referenced this issue Jul 22, 2022
Fix is in the ppDconPat function in ppabsyn.sml.  Needed to strip MARKpat from APPpat argument pattern.
dmacqueen added a commit that referenced this issue Jul 22, 2022
Added updates for bug fixes for issues #177 and #241.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler problem with compiler fixed-in-110.99.3 issues that will be fixed in the 110.99.3 version gforge bug (or feature request) ported from smlnj-gforge repository
Projects
None yet
Development

No branches or pull requests

2 participants