Files
swift-mirror/test/Serialization/Inputs/vtable-function-deserialization-input.swift
John McCall c8c41b385c Implement SE-0077: precedence group declarations.
What I've implemented here deviates from the current proposal text
in the following ways:

- I had to introduce a FunctionArrowPrecedence to capture the parsing
  of -> in expression contexts.

- I found it convenient to continue to model the assignment property
  explicitly.

- The comparison and casting operators have historically been
  non-associative; I have chosen to preserve that, since I don't
  think this proposal intended to change it.

- This uses the precedence group names and higherThan/lowerThan
  as agreed in discussion.
2016-07-26 14:04:57 -07:00

40 lines
666 B
Swift

// All of this is required in order to produce materializeForSet
// declarations for A's properties.
precedencegroup AssignmentPrecedence { assignment: true }
public protocol ExpressibleByNilLiteral {
init(nilLiteral: ())
}
public enum Optional<T> : ExpressibleByNilLiteral {
case none
case some(T)
public init(nilLiteral: ()) { self = .none }
}
public struct Y {}
public struct X<U> {
public var a : U
public init(_a : U) {
a = _a
}
public func doneSomething() {}
}
public class A {
public var y : Y
public var x : X<Y>
public init() {
y = Y()
x = X<Y>(_a: y)
}
public func doSomething() {
x.doneSomething()
}
}