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

-dsource assertion failure with attributes or extensions #6377

Closed
vicuna opened this Issue Apr 22, 2014 · 6 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link
Collaborator

vicuna commented Apr 22, 2014

Original bug ID: 6377
Reporter: @lpw25
Assigned to: @lpw25
Status: closed (set by @xavierleroy on 2015-12-11T18:28:04Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.0+dev
Fixed in version: 4.02.0+dev
Category: ~DO NOT USE (was: OCaml general)
Tags: patch
Monitored by: @hcarty

Bug description

There are some assertions in pprintast.ml which mean -dsource doesn't always work with attributes and extensions:

$ cat test.mli
[@@@break]

val x : int

$ ocamlc -dsource test.mli
Fatal error: exception File "parsing/pprintast.ml", line 948, characters 26-32: Assertion failed
(Program not linked with -g, cannot print stack backtrace)

File attachments

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Apr 23, 2014

Comment author: @alainfrisch

Indeed, pprintast has not been adapted. I'm not very comfortable with this piece of code, so any contribution is appreciated (a good contribution could be to replace the code with a more basic closed-recursion implementation).

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented May 30, 2014

Comment author: @mshinwell

Are we proposing to fix this for 4.02?

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented May 31, 2014

Comment author: @alainfrisch

-dsource and pprintast are quite useful to debug ppx rewriters, but as I wrote earlier, I'm not the good candidate for fixing this. If I spend more time looking at this file, I'll end up rewriting it completely, and this won't happen before 4.02.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented May 31, 2014

Comment author: @lpw25

I'll have a look at this and other "assert false"s in pprintast.ml sometime this week.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 8, 2014

Comment author: @lpw25

The attached patch adds printing for all attributes and extensions. It also fixes some whitespace issues and assertion failures.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Jun 10, 2014

Comment author: @alainfrisch

Thanks! Committed to 4.02 (revision 14981) after fixing conflict with commit 14956.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.