File tree Expand file tree Collapse file tree 8 files changed +116
-8
lines changed
tools/SourceKit/lib/SwiftLang
validation-test/Reflection Expand file tree Collapse file tree 8 files changed +116
-8
lines changed Original file line number Diff line number Diff line change @@ -1455,7 +1455,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
1455
1455
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
1456
1456
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
1457
1457
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1458
- refs/heads/master-rebranch: 0ae86c9c9d68e6eb8520fb4f1b54e9d04e25f772
1458
+ refs/heads/master-rebranch: 01c471757371200428746339f77000bc65c1a0f9
1459
1459
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
1460
1460
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
1461
1461
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
Original file line number Diff line number Diff line change @@ -736,7 +736,9 @@ void ASTMangler::appendOpaqueDeclName(const OpaqueTypeDecl *opaqueDecl) {
736
736
if (canSymbolicReference (opaqueDecl)) {
737
737
appendSymbolicReference (opaqueDecl);
738
738
} else if (auto namingDecl = opaqueDecl->getNamingDecl ()) {
739
+ CanGenericSignature savedSignature = CurGenericSignature;
739
740
appendEntity (namingDecl);
741
+ CurGenericSignature = savedSignature;
740
742
appendOperator (" QO" );
741
743
} else {
742
744
llvm_unreachable (" todo: independent opaque type decls" );
Original file line number Diff line number Diff line change @@ -123,6 +123,25 @@ add_custom_command_target(unused_var
123
123
COMMENT "Symlinking Clang resource headers into ${SWIFTLIB_DIR} /clang" )
124
124
add_dependencies (copy_shim_headers symlink_clang_headers )
125
125
126
+ if (NOT SWIFT_BUILT_STANDALONE )
127
+ if (TARGET clang-resource-headers ) # LLVM > 8
128
+ set (clang_resource_headers clang-resource-headers )
129
+ elseif (TARGET clang-headers ) # LLVM <= 8
130
+ set (clang_resource_headers clang-headers )
131
+ else ()
132
+ message (SEND_ERROR
133
+ "Unable to determine clang resource headers target in unified build" )
134
+ endif ()
135
+
136
+ foreach (target
137
+ symlink_clang_headers
138
+ clang-builtin-headers
139
+ clang-resource-dir-symlink
140
+ clang-builtin-headers-in-clang-resource-dir )
141
+ add_dependencies (${target} ${clang_resource_headers} )
142
+ endforeach ()
143
+ endif ()
144
+
126
145
swift_install_in_component (FILES ${sources}
127
146
DESTINATION "lib/swift/shims"
128
147
COMPONENT stdlib )
Original file line number Diff line number Diff line change
1
+ public protocol Proto {
2
+ associatedtype Assoc : Proto
3
+ var value : Assoc { get }
4
+ }
5
+
6
+ extension Never : Proto { }
7
+
8
+ extension Never {
9
+ public typealias Assoc = Never
10
+
11
+ public var value : Never {
12
+ switch self { }
13
+ }
14
+ }
15
+ protocol PrimitiveProto : Proto { }
16
+
17
+ extension PrimitiveProto {
18
+ public var value : Never { valueError ( ) }
19
+ }
20
+
21
+ extension Proto {
22
+ func valueError( ) -> Never {
23
+ fatalError ( " value() should not be called on \( Self . self) . " )
24
+ }
25
+ }
26
+
27
+ public struct EmptyProto : PrimitiveProto {
28
+ public init ( ) { }
29
+ }
30
+
31
+ struct M < Content: Proto > : Proto {
32
+ var t : Content
33
+
34
+ init ( _ t: Content ) {
35
+ self . t = t
36
+ }
37
+
38
+ var value : some Proto {
39
+ return t. value
40
+ }
41
+ }
42
+
43
+ public struct Group < T> {
44
+ var t : T
45
+
46
+ public init ( _ t: T ) {
47
+ self . t = t
48
+ }
49
+ }
50
+
51
+ extension Group : Proto , PrimitiveProto where T : Proto {
52
+ public typealias Assoc = Never
53
+ }
54
+
55
+ public struct Choice < T, V> {
56
+ var v : V
57
+
58
+ public init ( _ t: T , _ v: V ) {
59
+ self . v = v
60
+ }
61
+ }
62
+
63
+ extension Choice : Proto where T: Proto , V: Proto {
64
+ public var value : some Proto {
65
+ return v. value
66
+ }
67
+ }
68
+
69
+ extension Proto {
70
+ public func add( ) -> some Proto {
71
+ return M ( self )
72
+ }
73
+ }
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -disable-availability-checking -emit-module -enable-library-evolution -emit-module-path=%t/A.swiftmodule -module-name=A %S/Inputs/mangle-opaque-return-types-A.swift
3
+ // RUN: %target-swift-frontend -disable-availability-checking -I %t -emit-ir %s
4
+ import A
5
+
6
+ public struct C < T, Content: Proto > {
7
+ let data : T
8
+ let content : Content
9
+
10
+ init ( _ t: T , _ c: Content ) {
11
+ data = t
12
+ content = c
13
+ }
14
+
15
+ public var dontCrash : some Proto {
16
+ return Group ( Choice ( content, EmptyProto ( ) . add ( ) ) )
17
+ }
18
+ }
19
+
Original file line number Diff line number Diff line change @@ -49,3 +49,5 @@ add_sourcekit_library(SourceKitSwiftLang
49
49
objcarcopts
50
50
profiledata
51
51
)
52
+
53
+ add_dependencies (SourceKitSwiftLang clang-tablegen-targets )
Original file line number Diff line number Diff line change 7
7
// REQUIRES: objc_interop
8
8
// REQUIRES: executable_test
9
9
10
- // REQUIRES: OS=macosx || OS=ios || OS=tvos
11
- // NOTE: Test is temporarily disabled for watchOS until we can figure out why
12
- // it's failing there. rdar://problem/50898688
13
-
14
10
import Foundation
15
11
import simd
16
12
Original file line number Diff line number Diff line change 9
9
10
10
// REQUIRES: objc_interop
11
11
// REQUIRES: executable_test
12
- // REQUIRES: OS=macosx || OS=ios || OS=tvos
13
- // NOTE: Test is temporarily disabled for watchOS until we can figure out why
14
- // it's failing there. rdar://problem/50898688
15
12
16
13
import simd
17
14
import ObjCClasses
You can’t perform that action at this time.
0 commit comments