Skip to content

Conversation

@rudkx
Copy link
Contributor

@rudkx rudkx commented Sep 5, 2018

The support is gated by a frontend option, -enable-operator-designated-protocols.

This means that in an operator declaration we can declare a protocol
which has one or more requirements specifying this operator. The
operators from that designated protocol will be the first ones we try
when type checking an expression. If we successfully typecheck using
the operators specified in that protocol, we do not attempt any other
overloads of the same operator.

This makes it possible to dramatically speed up successful
typechecking.

Mark Lacey added 2 commits September 4, 2018 23:10
The support is gated by a frontend option,
-enable-operator-designated-protocols.

This means that in an operator declaration we can declare a protocol
which has one or more requirements specifying this operator. The
operators from that designated protocol will be the first ones we try
when type checking an expression. If we successfully typecheck using
the operators specified in that protocol, we do not attempt any other
overloads of the same operator.

This makes it possible to dramatically speed up successful
typechecking.
@rudkx
Copy link
Contributor Author

rudkx commented Sep 5, 2018

@swift-ci Please smoke test

@rudkx rudkx merged commit 1e7dae3 into swiftlang:master Sep 7, 2018
@rudkx rudkx deleted the parse-designated-protocol branch September 7, 2018 05:01
@jrose-apple
Copy link
Contributor

Yeah, I don't think parsing two identifiers is a good idea. Instead, you should be parsing two TypeLocs, and deciding later if one of them is an identifier that names a precedence group.

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