Skip to content

Add support for multiple designated types for an operator declaration. #19816

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 6 commits into from
Oct 12, 2018
Merged

Add support for multiple designated types for an operator declaration. #19816

merged 6 commits into from
Oct 12, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Oct 10, 2018

Add parsing, type checking, serialization, and deserialization support
for specifying multiple types as "designated" for operator lookup for
a given operator declaration.

The constraint solver still considers only the first type when
deciding the order to attempt the elements of a disjunction, so this
doesn't really change behavior yet.

rudkx added 2 commits October 9, 2018 23:17
Update the representation to allow for multiple types to be specified
for a single operator.

No parsing, serialization, or deserialization support yet, so NFC.
Add parsing, type checking, serialization, and deserialization support
for specifying multiple types as "designated" for operator lookup for
a given operator declaration.

The constraint solver still considers only the first type when
deciding the order to attempt the elements of a disjunction, so this
doesn't really change behavior yet.
@rudkx
Copy link
Contributor Author

rudkx commented Oct 10, 2018

@swift-ci Please smoke test

@rudkx rudkx changed the title Add support for multiple designated types for an operator declaration. [WIP] Add support for multiple designated types for an operator declaration. Oct 10, 2018
@rudkx
Copy link
Contributor Author

rudkx commented Oct 10, 2018

It looks like I missed a few printing changes so I'll finish those up and push another commit tomorrow.

@rudkx rudkx changed the title [WIP] Add support for multiple designated types for an operator declaration. Add support for multiple designated types for an operator declaration. Oct 10, 2018
@rudkx
Copy link
Contributor Author

rudkx commented Oct 10, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@swift-ci Please smoke test Linux platform

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@swift-ci Please smoke test Linux platform

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@dmbryson Is this issue that popped up in my linux build one you're already aware of?

10:39:49 Failing Tests (1):
10:39:49     llbuild :: BuildSystem/Build/lane-release.llbuild

Here's the log: https://ci.swift.org/job/swift-PR-Linux-smoke-test/10353/consoleFull#-906433348ba62d58e-7248-467b-91e0-c7508d5cf947

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

Will retry in case this is a non-deterministic failure.

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@swift-ci Please smoke test Linux platform

@dmbryson
Copy link

:/ Not sure what happened there. There should have been more detailed log messages for any of the failure conditions.

@dmbryson
Copy link

Hmm, failed again. Very strange.

@dmbryson
Copy link

Looking into it: rdar://problem/45196629 lane-release.llbuild test is failing in some Swift-CI linux runs

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Oct 11, 2018

@rintaro @harlanhaskins It's not clear to me if there is a better way to deal with the libSyntax update here. This captures the syntax, but nothing about the semantic meaning of the identifiers in the list after the colon.

''',
is_optional=True),
]),

Node('IdentifierList', kind='SyntaxCollection',
element='IdentifierToken'),

# infix-operator-group -> ':' identifier ','? identifier?
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this grammar to:

# infix-operator-group -> ':' identifier-list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I'll fix that up.

''',
is_optional=True),
]),

Node('IdentifierList', kind='SyntaxCollection',
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs another production that includes a trailing comma after each identifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I patterned this on what was happening for inheritance with InheritedTypeList. I don't see any notion of a comma-separated list there. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I missed InheritedType which has the trailing comma embedded in it.

@rudkx
Copy link
Contributor Author

rudkx commented Oct 12, 2018

Latest error:

/home/buildnode/jenkins/workspace/swift-PR-Linux-smoke-test/branch-master/swift-corelibs-libdispatch/src/swift/Block.swift:43:73: error: cannot convert value of type 'UInt32' to expected argument type 'UInt'
16:15:46                 _block =  dispatch_block_create_with_qos_class(dispatch_block_flags_t(UInt32(flags.rawValue)),

@rudkx
Copy link
Contributor Author

rudkx commented Oct 12, 2018

@swift-ci Please smoke test Linux platform

@rudkx
Copy link
Contributor Author

rudkx commented Oct 12, 2018

I'll merge the other Swift syntax fixes in a separate PR.

@rudkx rudkx merged commit ab0ae73 into swiftlang:master Oct 12, 2018
@rudkx rudkx deleted the extend-operator-designated-type branch October 12, 2018 22: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