Skip to content

[SR-436] Parse failure that shouldn’t be #43053

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

Open
dabrahams opened this issue Jan 1, 2016 · 2 comments
Open

[SR-436] Parse failure that shouldn’t be #43053

dabrahams opened this issue Jan 1, 2016 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself parser Area → compiler: The legacy C++ parser

Comments

@dabrahams
Copy link
Contributor

Previous ID SR-436
Radar None
Original Reporter @dabrahams
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Parser
Assignee None
Priority Medium

md5: 949afa5de508847771a1512d49cf0f05

Issue Description:

In 16c0d65,

1 as Int16 << 7

yields an “Expected type” failure, but shouldn’t.

@Dante-Broggi
Copy link
Contributor

Interestingly, the provided code still produces the same error in the Xcode 9.4.1 toolchain.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the good first issue Good for newcomers label Jun 20, 2022
@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Jun 20, 2022

The problem is that parseTypeIdentifier does an unconditional startsWithLess check for whether to anticipate a generic parameter list. Happens to be a great starter bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself parser Area → compiler: The legacy C++ parser
Projects
None yet
3 participants