Skip to content

Use const instead of immutable for compatibility with new libdparse#805

Closed
Hackerpilot wants to merge 1 commit intomasterfrom
new-dparse-compat
Closed

Use const instead of immutable for compatibility with new libdparse#805
Hackerpilot wants to merge 1 commit intomasterfrom
new-dparse-compat

Conversation

@Hackerpilot
Copy link
Collaborator

Looks like the libdparse token changes weren't as backwards-compatible as we hoped. See #799 (comment)

@Hackerpilot Hackerpilot requested a review from WebFreak001 April 27, 2020 18:35
@WebFreak001
Copy link
Member

hm I'm not quite sure how these changes are related to the token structure changes. Did including the const arrays make it impossible to be immutable?

In this case would changing

    const(typeof(this))[] leadingTrivia;
    /// ditto
    const(typeof(this))[] trailingTrivia;

in libdparse to

    immutable(typeof(this))[] leadingTrivia;
    /// ditto
    immutable(typeof(this))[] trailingTrivia;

be the needed fix? The appender data is dup'd anyway, it could probably be changed to idup without issues.

WebFreak001 added a commit to WebFreak001/libdparse that referenced this pull request Apr 28, 2020
Fixes immutable assignment of tokens to variables (See dlang-community/D-Scanner#805)
Copy link
Member

@WebFreak001 WebFreak001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing it here isn't the right approach imo, I submitted a PR to libdparse to fix it there instead

@Hackerpilot Hackerpilot deleted the new-dparse-compat branch April 29, 2020 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants