Files
swift-mirror/test/IDE/Inputs/foo_swift_module.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

64 lines
1.2 KiB
Swift

infix operator %%% : High
precedencegroup High {
associativity: left
higherThan: BitwiseShiftPrecedence
}
public func %%% (lhs: Int, rhs: Int) -> Int {
return lhs + rhs
}
postfix operator =>
public postfix func =>(lhs: Int) -> Int {
return lhs + 1
}
postfix operator =->
internal postfix func =->(lhs: Int) -> Int {
return lhs + 1
}
public func visibleImport() {}
public func hiddenImport() {}
public func overlayedFoo() {}
public var globalVar: Int = 0
/// FooSwiftStruct Aaa.
/**
* Bbb.
* Ccc.
*/
public struct FooSwiftStruct {
// Indentation is incorrect on purpose, don't fix this.
/// fooInstanceFunc Aaa.
/**
* Bbb
*/
/**
* Ccc.
*/
public func fooInstanceFunc() {}
public init() {}
}
public struct BarGenericSwiftStruct1<T> {
public init(t: T) {}
public func bar1InstanceFunc() {}
}
public protocol BarProtocol {
func instanceFunc()
}
public struct BarGenericSwiftStruct2<T: BarProtocol, U> {
public init(t: T, u: U) {}
public func bar2InstanceFunc() {}
}
/// rdar://18457785
public enum MyQuickLookObject {
/// A rectangle.
///
/// Uses explicit coordinates to avoid coupling a particular Cocoa type.
case Rectangle(Float64,Float64,Float64,Float64)
}