Merge pull request #18778 from jrose-apple/towards-stability

[ModuleInterface] More changes to printing and parsing .swiftinterface files
This commit is contained in:
Jordan Rose
2018-08-17 09:10:57 -07:00
committed by GitHub
7 changed files with 129 additions and 34 deletions

View File

@@ -22,10 +22,21 @@ public class TestClass {
// CHECK: public var prop: Int{{$}}
public var prop: Int { get set }
// CHECK: public static var propWithNoAccessors: Int{{$}}
public static var propWithNoAccessors: Int
// NEGATIVE-NOT: deinit
deinit
} // CHECK: {{^}$}}
// CHECK-LABEL: public class TestEmptyClass {
public class TestEmptyClass {
} // CHECK-NEXT: {{^}$}}
// CHECK-LABEL: public struct TestEmptyStruct {
public struct TestEmptyStruct {
} // CHECK-NEXT: {{^}$}}
// CHECK-LABEL: public enum TestEnum
public enum TestEnum {
// CHECK: case a
@@ -42,6 +53,9 @@ public enum TestEnum {
// CHECK: public var prop: Int{{$}}
public var prop: Int { get set }
// CHECK: public static var propWithNoAccessors: Int{{$}}
public static var propWithNoAccessors: Int
} // CHECK: {{^}$}}
// CHECK-LABEL: public struct TestStruct
@@ -57,8 +71,14 @@ public struct TestStruct {
// CHECK: public var prop: Int{{$}}
public var prop: Int { get set }
// CHECK: public static var propWithNoAccessors: Int{{$}}
public static var propWithNoAccessors: Int
} // CHECK: {{^}$}}
// CHECK: public let globalWithNoAccessors: Int{{$}}
public let globalWithNoAccessors: Int
// CHECK: public var readOnlyVar: Int { get }{{$}}
public var readOnlyVar: Int { get }

View File

@@ -0,0 +1,20 @@
// RUN: %target-swift-frontend -emit-interface-path %t.swiftinterface -emit-module -o /dev/null %s
// RUN: %FileCheck %s < %t.swiftinterface
// RUN: %FileCheck -check-prefix NEGATIVE %s < %t.swiftinterface
// CHECK-LABEL: public protocol SimpleProto {
public protocol SimpleProto {
// CHECK: associatedtype Element
associatedtype Element
// CHECK: associatedtype Inferred
associatedtype Inferred
func inference(_: Inferred)
} // CHECK: {{^}$}}
// CHECK-LABEL: public struct SimplImpl<Element> : SimpleProto {
public struct SimplImpl<Element>: SimpleProto {
// NEGATIVE-NOT: typealias Element =
// CHECK: public func inference(_: Int){{$}}
public func inference(_: Int) {}
// CHECK: public typealias Inferred = Swift.Int
} // CHECK: {{^}$}}