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

[SR-5509] Array of operators parsing issue #48081

Open
swift-ci opened this issue Jul 19, 2017 · 4 comments
Open

[SR-5509] Array of operators parsing issue #48081

swift-ci opened this issue Jul 19, 2017 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself parser Area → compiler: The legacy C++ parser

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5509
Radar rdar://problem/33407494
Original Reporter adtrevor (JIRA User)
Type Bug
Environment

macOS 10.12.4 (16E195), Xcode 9

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Parser
Assignee None
Priority Medium

md5: c5ef5d5ff95217241cad42ac6f69bae5

Issue Description:

Given a function like this one:

func <T:Comparable>f(arg: T, array: [(T,T)->Bool]) {}

This doesn't compile :

f(arg: 10, array: [<, >, <, <])

There are three errors at the function call line:

Expected expression after unary operator
Expected expression in container literal
Missing argument for parameter 'array' in call

As @jckarter explained this fixes the problem:

f(arg: 10, array: [(<), (>), (<), (<)])

Thank you ! 🙂

@jckarter
Copy link
Member

Using operators works in function arguments, so it seems to me like it should just work the same way in an array literal.

@jckarter
Copy link
Member

@swift-ci create

@gwynne
Copy link
Contributor

gwynne commented Jan 27, 2020

@jckarter Seems like this still exists to this day...

@gwynne
Copy link
Contributor

gwynne commented Jan 27, 2020

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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 in itself parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

3 participants