Skip to content

[Parser] Fix right angle location in erroneous parameter list #5099

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

Merged
merged 1 commit into from
Oct 24, 2016

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 3, 2016

If > could not be found, the skipUntilGreaterInTypeList should return the location of the
last token consumed, instead of the current token.
Previously, it may cause ASTVerifier error "child source range not contained within its parent" in some cases. Or highlight overrun in diagnostics:

error: protocol composition is neither allowed nor needed here
    associatedtype A: protocol<P1 }
                      ^~~~~~~~~~~~~

Resolves compiler_crashers/28429-swift-decl-print.swift .

If '>' could not be found, the parser should return the location of the
last token parsed, instead of the current token.
Previously, it may causes ASTVerifier error "child source range not contained
within its parent" in some cases.
@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

Nice catch!

Does this resolve any compiler crashers? :)

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test and merge

@swift-ci swift-ci merged commit 5877db3 into swiftlang:master Oct 24, 2016
@rintaro rintaro deleted the rangle-location branch October 24, 2016 07:47
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.

3 participants