mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #18778 from jrose-apple/towards-stability
[ModuleInterface] More changes to printing and parsing .swiftinterface files
This commit is contained in:
@@ -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 }
|
||||
|
||||
|
||||
20
test/ModuleInterface/conformances.swift
Normal file
20
test/ModuleInterface/conformances.swift
Normal 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: {{^}$}}
|
||||
Reference in New Issue
Block a user