content stringlengths 1 103k ⌀ | path stringlengths 8 216 | filename stringlengths 2 179 | language stringclasses 15
values | size_bytes int64 2 189k | quality_score float64 0.5 0.95 | complexity float64 0 1 | documentation_ratio float64 0 1 | repository stringclasses 5
values | stars int64 0 1k | created_date stringdate 2023-07-10 19:21:08 2025-07-09 19:11:45 | license stringclasses 4
values | is_test bool 2
classes | file_hash stringlengths 32 32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
// RUN: %target-typecheck-verify-swift\n\nprotocol Q {}\n\nextension Int: Q {}\n\n///\n\nprotocol P1 {\n associatedtype A: Q\n associatedtype B: Q\n\n func f(_: A)\n func g(_: B)\n}\n\nextension P1 {\n func f(_: B) {}\n func g(_: A) {}\n}\n\nstruct S1a: P1 {\n func f(_: Int) {}\n}\n\nstruct S1b: P1 {\n func g(_... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_abstract.swift | associated_type_inference_abstract.swift | Swift | 967 | 0.8 | 0 | 0.090909 | vue-tools | 861 | 2024-11-27T12:31:34.685246 | MIT | true | 0be64b16b4236559d21d903e7830d560 |
// RUN: %target-typecheck-verify-swift\n\n// Reduced from the distributed actors implementation. This didn't type check in 5.10\n// but works now.\n\nprotocol DistributedActorSystem<SerializationRequirement> {\n associatedtype SerializationRequirement\n}\n\nprotocol DistributedActor where SerializationRequirement == A... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_distributed.swift | associated_type_inference_distributed.swift | Swift | 738 | 0.95 | 0.047619 | 0.2 | react-lib | 102 | 2024-01-24T09:14:57.008220 | GPL-3.0 | true | f28b55a40f9b88b3c263ff367786442b |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype A\n\n func f(_: A) -> Self\n}\n\nclass C1: P {\n func f(_: Int) -> Self {}\n}\n\nclass Base {\n func f(_: String) -> Self {}\n}\n\nclass Derived: Base, P {}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_dynamic_self.swift | associated_type_inference_dynamic_self.swift | Swift | 217 | 0.95 | 0.176471 | 0.083333 | awesome-app | 988 | 2023-12-07T13:15:45.833531 | MIT | true | 3162fe9cefa324081d7dfa6878610e82 |
// RUN: %target-typecheck-verify-swift\n\n// Inspired by GRDB.swift.\n\nprotocol P {\n associatedtype A\n associatedtype B\n func f1(_: A)\n func f2(_: A)\n func f3(_: A)\n func f4(_: A)\n func f5(_: A)\n func f6(_: A)\n func f7(_: A)\n func f8(_: A)\n func f9(_: A)\n func f10(_: A)\n func f11(_: A)\n fun... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_exponential.swift | associated_type_inference_exponential.swift | Swift | 2,664 | 0.8 | 0 | 0.014286 | react-lib | 863 | 2024-12-26T05:43:51.122839 | GPL-3.0 | true | 5fe8cfced73d97f7b3d91c1b6555ef93 |
// RUN: %target-typecheck-verify-swift\n\nprotocol P1 {}\nprotocol P2 {}\nprotocol P3 {}\nprotocol P4 {}\nprotocol P5 {}\nprotocol P6 {}\nprotocol P7 {}\nprotocol P8 {}\nprotocol P9 {}\nprotocol P10 {}\nprotocol P11 {}\nprotocol P12 {}\nprotocol P13 {}\nprotocol P14 {}\nprotocol P15 {}\nprotocol P16 {}\n\nprotocol P {\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_exponential_2.swift | associated_type_inference_exponential_2.swift | Swift | 1,626 | 0.8 | 0 | 0.017544 | react-lib | 284 | 2025-06-14T06:05:05.517633 | Apache-2.0 | true | 4796d1f525f299e50aeb988f06ba4458 |
// RUN: %target-typecheck-verify-swift\n// RUN: not %target-swift-frontend -typecheck -dump-type-witness-systems %s 2>&1 | %FileCheck %s\n\nprotocol P1 where A == Never {\n associatedtype A\n}\n\nstruct S1: P1 {}\n\nprotocol P2a {\n associatedtype A\n}\nprotocol P2b: P2a where A == Never {}\nprotocol P2c: P2b {}\n\ns... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_fixed_type_experimental_inference.swift | associated_type_inference_fixed_type_experimental_inference.swift | Swift | 28,415 | 0.95 | 0.105324 | 0.358134 | python-kit | 249 | 2023-12-29T20:29:49.265036 | MIT | true | 96a52f24be94debb9ca51cd849cf8bc8 |
// RUN: %target-typecheck-verify-swift\n\n// REQUIRES: objc_interop\n\nimport Foundation\n\npublic struct CustomCollection<T>: RandomAccessCollection {\n public typealias Indices = Range<Int>\n \n public var startIndex: Int { fatalError() }\n public var endIndex: Int { fatalError() }\n public var count: ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_foundation_1.swift | associated_type_inference_foundation_1.swift | Swift | 865 | 0.95 | 0 | 0.083333 | node-utils | 616 | 2025-04-18T19:28:53.345388 | GPL-3.0 | true | 09dbef662e9b20ca8cd1240bb5294b14 |
// RUN: %target-typecheck-verify-swift\n\n// REQUIRES: objc_interop\n\nimport Foundation\n\npublic struct CustomCollection<Element>: RandomAccessCollection, MutableCollection, ExpressibleByArrayLiteral {\n public typealias Indices = Range<Int>\n public typealias Index = Int\n\n public init() {}\n\n public i... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_foundation_2.swift | associated_type_inference_foundation_2.swift | Swift | 1,492 | 0.95 | 0 | 0.060606 | vue-tools | 623 | 2024-03-16T13:43:47.698332 | Apache-2.0 | true | 88b2505c09335061eba3bc39fa9d5814 |
// RUN: %target-typecheck-verify-swift\n\nclass C<T> {}\n\nprotocol P {\n associatedtype A: C<B> // expected-note 2{{protocol requires nested type 'A'}}\n associatedtype B // expected-note 2{{protocol requires nested type 'B'}}\n\n func f() -> A\n func g() -> B\n}\n\nclass D: C<Int> {}\n\nstruct S11: P {\n typeali... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_generic_class.swift | associated_type_inference_generic_class.swift | Swift | 1,709 | 0.95 | 0.045455 | 0.015385 | react-lib | 407 | 2024-06-07T14:26:51.771858 | Apache-2.0 | true | ca219f2e64d23b5d823d62e54cf8fa41 |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype A\n}\n\nprotocol Q: P {\n associatedtype A\n func f() -> A\n}\n\nprotocol R: Q {}\n\n// We don't have enough information to infer 'A' just from the 'S1: P' and\n// 'S2: P' conformances. Make sure that if we force one of those conformances\n// fi... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_more_specific.swift | associated_type_inference_more_specific.swift | Swift | 586 | 0.95 | 0.032258 | 0.227273 | react-lib | 211 | 2023-09-18T14:01:13.859438 | MIT | true | 5402c4f5a7d6f1fc10129afdfa506007 |
// RUN: %target-typecheck-verify-swift\n\n// REQUIRES: objc_interop\n\nimport Foundation\n\nprotocol P1 {\n associatedtype A: NSObject\n}\n\n@objc protocol P2 {}\n\nstruct S: P1 {\n typealias A = NSObject & P2\n}\n\nlet x: (any NSObject & P2).Type = S.A.self\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_objc_existential.swift | associated_type_inference_objc_existential.swift | Swift | 245 | 0.95 | 0 | 0.181818 | python-kit | 613 | 2023-11-23T03:29:52.924453 | BSD-3-Clause | true | 29342b1a8eb1a8e20423e20dc84e090d |
// RUN: %target-typecheck-verify-swift\n\nstruct Box<T> {}\n\ninfix operator =*=\nprotocol P1 {\n associatedtype A\n static func =*= (x: Self, y: Box<A>)\n}\nclass C1<A>: P1 {\n static func =*= (x: C1, y: Box<A>) {}\n}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_operator.swift | associated_type_inference_operator.swift | Swift | 211 | 0.95 | 0.083333 | 0.1 | node-utils | 446 | 2023-11-02T14:22:55.759931 | GPL-3.0 | true | 7c2fb07cf4ac9b095b1709643df34868 |
// RUN: %target-typecheck-verify-swift\n\nfunc assertEqualTypes<T>(_: T.Type, _: T.Type) {}\n\nstruct Pair<A, B> {\n var a: A\n var b: B\n}\n\nextension Pair: Codable where A: Codable, B: Codable {}\n\nextension Pair: Collection where A == B {\n// expected-error@-1 {{conditional conformance of type 'Pair<A, B>' t... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_proto_ext.swift | associated_type_inference_proto_ext.swift | Swift | 1,691 | 0.8 | 0.015873 | 0.14 | vue-tools | 184 | 2023-08-02T16:25:11.045722 | GPL-3.0 | true | aafb4a20cab6f2e94df4f23abb43bad5 |
// RUN: %target-typecheck-verify-swift\n\n// We would fail here when Indices was explicitly specified, as in X2.\n\npublic struct X1: RandomAccessCollection {\n public var startIndex: Int {\n return 0\n }\n\n public var endIndex: Int {\n return 0\n }\n\n public subscript(position: Int) -> String {\n retur... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib.swift | associated_type_inference_stdlib.swift | Swift | 564 | 0.8 | 0 | 0.08 | react-lib | 903 | 2025-04-04T13:54:47.558404 | Apache-2.0 | true | dde1492113664fa6491cc65d9d0a93eb |
// RUN: %target-typecheck-verify-swift\n\nprotocol IP {\n associatedtype E\n\n func next() -> E?\n}\n\nprotocol S {\n associatedtype I: IP\n associatedtype E where E == I.E\n\n func makeI() -> I\n}\n\nstruct G: S {\n struct I: IP {\n func next() -> Int? {}\n }\n\n func makeI() -> I {}\n}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib_2.swift | associated_type_inference_stdlib_2.swift | Swift | 279 | 0.8 | 0 | 0.0625 | vue-tools | 64 | 2023-12-21T21:45:46.212401 | GPL-3.0 | true | e8b2566c281f86fee652ee2578dfafc1 |
// RUN: %target-typecheck-verify-swift\n\nstruct FooIterator<T: Sequence>: IteratorProtocol {\n typealias Element = T.Element\n\n mutating func next() -> Element? { fatalError() }\n}\n\nstruct FooSequence<Element>: Sequence {\n func makeIterator() -> FooIterator<Self> { fatalError() }\n}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib_3.swift | associated_type_inference_stdlib_3.swift | Swift | 282 | 0.8 | 0 | 0.125 | react-lib | 209 | 2023-08-05T21:38:09.967508 | BSD-3-Clause | true | 910440669a70dbfba5b1fd912b9d5c86 |
// RUN: %target-swift-frontend -emit-silgen %s -DA1\n// RUN: %target-swift-frontend -emit-silgen %s -DA2\n// RUN: %target-swift-frontend -emit-silgen %s -DA3\n// RUN: %target-swift-frontend -emit-silgen %s -DA4\n// RUN: %target-swift-frontend -emit-silgen %s -DA5\n// RUN: %target-swift-frontend -emit-silgen %s -DA6\n//... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib_4.swift | associated_type_inference_stdlib_4.swift | Swift | 2,503 | 0.8 | 0.021739 | 0.47541 | python-kit | 793 | 2025-05-13T17:27:21.860338 | Apache-2.0 | true | 5492f1af7302097620c4c588cf37a8cc |
// RUN: %target-swift-frontend -emit-silgen %s -DA1\n// RUN: %target-swift-frontend -emit-silgen %s -DA2\n// RUN: %target-swift-frontend -emit-silgen %s -DA3\n// RUN: %target-swift-frontend -emit-silgen %s -DA4\n// RUN: %target-swift-frontend -emit-silgen %s -DA5\n// RUN: %target-swift-frontend -emit-silgen %s -DA6\n//... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib_4a.swift | associated_type_inference_stdlib_4a.swift | Swift | 2,658 | 0.8 | 0.021978 | 0.47541 | react-lib | 458 | 2024-03-30T03:17:04.010149 | GPL-3.0 | true | 60db4e842284113d450013d375e876fb |
// RUN: %target-swift-frontend -emit-silgen %s\n\n// Reduced from swift-nio.\n\npublic protocol AppendableCollection: Collection {\n mutating func append(_ newElement: Self.Iterator.Element)\n}\n\npublic struct CircularBuffer<E>: AppendableCollection {\n public mutating func append(_ value: E) {\n fatalErr... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_stdlib_5.swift | associated_type_inference_stdlib_5.swift | Swift | 985 | 0.8 | 0 | 0.047619 | vue-tools | 748 | 2024-08-16T23:17:11.127786 | MIT | true | fbf9ec344a4c1ed1678a17715ef355fe |
// RUN: %target-typecheck-verify-swift\n\n// A := G<A> is unsatisfiable and not a tautology!\n\nprotocol P1 {\n associatedtype A\n associatedtype B\n\n func f(_: A, _: B)\n func g(_: A, _: B)\n}\n\nstruct G<T> {}\n\nextension P1 {\n // These two are not candidate witnesses at all!\n func f(_: G<A>, _: Int) {}\n ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_tautology.swift | associated_type_inference_tautology.swift | Swift | 1,354 | 0.8 | 0 | 0.185185 | vue-tools | 22 | 2024-12-03T11:16:57.818843 | MIT | true | 230696b99272fcb9189fd01398bcdefc |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype A: Q = Int\n\n func f(_: A)\n}\n\nprotocol Q {}\n\nextension Int: Q {}\nextension String: Q {}\n\nstruct S: P {\n // The presence of this overload where Float does not conform to Q would confuse\n // the solver and it would find two ambiguous s... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_tautology_2.swift | associated_type_inference_tautology_2.swift | Swift | 419 | 0.8 | 0 | 0.2 | python-kit | 912 | 2024-03-24T03:25:53.581491 | MIT | true | 02c2cb0f2654a55a6d032b977be8047a |
// RUN: %target-typecheck-verify-swift\n\n// We can't infer anything from 'Self', but we must still validate the\n// binding.\n\nprotocol P1 {\n associatedtype A\n\n func f(_: Self, _: A)\n}\n\nstruct S1: P1 {\n // Don't consider this f(); A := Float is not a candidate type witness.\n func f(_: Int, _: Float) {}\n\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_tautology_3.swift | associated_type_inference_tautology_3.swift | Swift | 370 | 0.8 | 0 | 0.307692 | python-kit | 465 | 2024-10-07T10:56:22.427580 | Apache-2.0 | true | 34f9b420dabf6d48621f32e3a94cc19f |
// RUN: %target-typecheck-verify-swift\n\n// An inner generic parameter of the protocol requirement should not\n// match against a concrete type in the witness.\n\nprotocol P2 {\n associatedtype A\n func f<T>(_: T, _: A)\n}\n\nstruct S2<A>: P2 {\n // These are not candiate witnesses for the requirement.\n func f(_:... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_tautology_4.swift | associated_type_inference_tautology_4.swift | Swift | 432 | 0.95 | 0.052632 | 0.285714 | vue-tools | 956 | 2024-12-01T09:24:36.315527 | MIT | true | 4a4496f79576032148dd05957f36f41c |
// RUN: %target-swift-frontend -emit-silgen %s\n\n// This is a SILGen test to ensure we can completely check these conformances\n// and build valid AST.\n\nprotocol P {\n associatedtype T : Q = S\n typealias Y = T.X\n\n func foo(_: T.X)\n}\n\nprotocol Q {\n associatedtype X\n}\n\nstruct S : Q {\n typealias X = ()\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_inference_valid.swift | associated_type_inference_valid.swift | Swift | 361 | 0.8 | 0 | 0.166667 | python-kit | 940 | 2024-07-19T00:52:26.202273 | Apache-2.0 | true | 2d0b20c9ec1164052cb1f0e980c64fdc |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype Body: P\n var body: Body { get }\n}\n\n// The S: P conformance should pick up 'var body'\n// from 'extension PP'.\nstruct S<T> {}\nextension S : P, PP where T : P {}\n\nprotocol PP : P {}\nextension PP {\n var body: Never { fatalError() }\n}\n\n... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_protocol_extension.swift | associated_type_protocol_extension.swift | Swift | 327 | 0.8 | 0 | 0.214286 | react-lib | 708 | 2024-12-21T03:24:01.571556 | BSD-3-Clause | true | 530e38cf159bd0400cb2db1ee6669e18 |
// RUN: %target-typecheck-verify-swift -enable-experimental-feature TupleConformances\n\n// REQUIRES: swift_feature_TupleConformances\n\ntypealias Tuple<each T> = (repeat each T)\n\nprotocol P1 {\n associatedtype A // expected-note {{protocol requires nested type 'A'}}\n}\n\nextension Tuple: P1 where repeat each T: P1... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\associated_type_tuple.swift | associated_type_tuple.swift | Swift | 1,209 | 0.95 | 0.107143 | 0.2 | vue-tools | 307 | 2024-11-10T03:31:30.914780 | GPL-3.0 | true | 60867e0f1faf7f2433f2a5c459634a74 |
// RUN: %target-typecheck-verify-swift\n// RUN: %target-swift-frontend -emit-silgen %s -parse-as-library -module-name Test -experimental-lazy-typecheck\n\n// This file should type check successfully.\n\n// rdar://117442510\npublic protocol P1 {\n associatedtype Value\n\n func makeValue() -> Value\n func useProducedV... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\assoc_type_inference_cycle.swift | assoc_type_inference_cycle.swift | Swift | 3,715 | 0.8 | 0 | 0.064516 | python-kit | 194 | 2023-10-27T19:15:47.845325 | GPL-3.0 | true | 8a9873e41a7e0f5ad4eb961c447507ee |
// RUN: %target-typecheck-verify-swift\n\npublic protocol Q1 {}\npublic protocol Q2 {}\n\nprotocol P1 {\n associatedtype A\n func f<T: Q1>(_: T) -> A\n}\n\nprotocol P2 {\n associatedtype A\n func f<T: Q2>(_: T) -> A\n}\n\nstruct S1 {}\nstruct S2 {}\n\n// Associated type inference isn't smart enough to reaso... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\identical_solutions.swift | identical_solutions.swift | Swift | 589 | 0.95 | 0 | 0.217391 | awesome-app | 675 | 2025-02-20T22:36:59.098861 | BSD-3-Clause | true | 21b5a0037f47d11af63c3ee296f1e1a2 |
// RUN: %target-typecheck-verify-swift\n\nstruct G<T> {}\n \nprotocol P {\n associatedtype T\n associatedtype U\n}\n\nprotocol Q: P where T == G<U> {}\n\nprotocol R: Q where U == Int {}\n\nstruct X: R {}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\issue-53221.swift | issue-53221.swift | Swift | 194 | 0.8 | 0 | 0.111111 | node-utils | 582 | 2024-04-04T06:16:23.011439 | Apache-2.0 | true | c37e3e5c4de128315a1153b6622e51ca |
// RUN: %target-typecheck-verify-swift\n\n// https://github.com/apple/swift/issues/57765\n\npublic protocol P {}\n\nextension Array {\n public struct Inner {}\n}\n\nextension Array.Inner:\n BidirectionalCollection,\n Collection,\n MutableCollection,\n RandomAccessCollection,\n Sequence\nwhere Element: P {\n publ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\issue-57765.swift | issue-57765.swift | Swift | 763 | 0.8 | 0 | 0.076923 | awesome-app | 79 | 2023-07-17T15:16:32.726153 | MIT | true | 5e031e0a082cfbe819532c9d8fa99723 |
// RUN: %target-typecheck-verify-swift\n\nprotocol RequiresIntFunction {\n associatedtype A = ()\n func intFunction(_ x: Int, _ a: A) -> Bool\n}\n\nstruct Regular<A>: RequiresIntFunction {\n func intFunction(_ x: Int, _ a: A) -> Bool {\n true\n }\n}\n\nstruct GenericBad<A>: RequiresIntFunction {\n func intFunct... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\issue-71216.swift | issue-71216.swift | Swift | 372 | 0.8 | 0 | 0.066667 | python-kit | 842 | 2025-02-25T11:14:15.085432 | MIT | true | 6235b47d5d912bc4854161ddbdb623f1 |
// RUN: %target-swift-frontend -emit-ir %s\n\n// https://github.com/swiftlang/swift/issues/75371\n\npublic protocol MyProtocol {\n associatedtype Value = Self\n\n static var originalValue: Value { get }\n static var copyValue: Value { get }\n}\n\npublic struct MyStruct: MyProtocol {}\n\nextension MyStruct {\n ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\issue-75371.swift | issue-75371.swift | Swift | 401 | 0.8 | 0 | 0.166667 | react-lib | 723 | 2023-08-09T20:57:20.170997 | BSD-3-Clause | true | e39e031b9d07c1339728c0da414e44aa |
// RUN: %target-typecheck-verify-swift\n\n// https://github.com/swiftlang/swift/issues/79367\n\n// 'Failure' type witness inference should still take place when\n// the 'next()' witness is in a different extension than the\n// conformance.\n\nstruct AsyncIteratorImpl<Element>: AsyncIteratorProtocol {}\n\nextension Asyn... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\issue-79367.swift | issue-79367.swift | Swift | 390 | 0.8 | 0 | 0.454545 | awesome-app | 23 | 2024-04-09T19:33:15.052120 | BSD-3-Clause | true | 89308a91201ead58b890c902caf68d34 |
// RUN: %target-typecheck-verify-swift\n\n// Test candidates for witnesses that are missing conformances\n// in various ways.\n\nprotocol LikeSetAlgebra {\n func onion(_ other: Self) -> Self // expected-note {{protocol requires function 'onion' with type '(X) -> X'}}\n func indifference(_ other: Self) -> Self // ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\missing_conformance.swift | missing_conformance.swift | Swift | 7,141 | 0.95 | 0.207317 | 0.123188 | react-lib | 72 | 2023-11-26T09:09:24.334552 | MIT | true | 15084c2f76cdc57a0580ecd8b6666073 |
// RUN: %target-typecheck-verify-swift\n\npublic protocol FakeCopyable {}\n\nextension Int: FakeCopyable {}\n\n// Remove both 'FakeCopyable' requirements below and \n// inference for Element in Hello succeeds.\n\npublic protocol MyIteratorProtocol<Element> {\n associatedtype Element : FakeCopyable\n\n mutating func n... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar118998138.swift | rdar118998138.swift | Swift | 1,100 | 0.95 | 0.018868 | 0.157895 | vue-tools | 138 | 2025-03-14T08:37:35.064154 | GPL-3.0 | true | c31e703cbcb7ff65cb264d5003d1968d |
// RUN: %target-typecheck-verify-swift\n\npublic protocol LazySequenceProtocol: Sequence {\n associatedtype Elements: Sequence = Self where Elements.Element == Element\n}\n\npublic struct S<Base: Sequence>: LazySequenceProtocol {\n public struct Iterator: IteratorProtocol {\n public mutating func next() -> Base.El... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122574126.swift | rdar122574126.swift | Swift | 463 | 0.8 | 0 | 0.066667 | vue-tools | 772 | 2024-01-27T18:59:07.066146 | MIT | true | 5da69ebc90cd17e81828fcf774b1f95a |
// RUN: %target-typecheck-verify-swift\n\npublic struct DefaultA {}\n\npublic protocol P {\n associatedtype A = DefaultA\n associatedtype B\n\n static func foo(_: A, _: B)\n static func bar(_: B)\n}\n\nextension P {\n public static func foo(_: A, _: B) where B == Void {}\n}\n\n// The only way C can confo... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122584912.swift | rdar122584912.swift | Swift | 620 | 0.95 | 0.04 | 0.2 | awesome-app | 625 | 2024-12-12T11:57:25.909539 | MIT | true | a70d3a0e664583c746a74c6b632c224f |
// RUN: %target-typecheck-verify-swift\n\npublic struct S: P {}\n\npublic protocol P: Collection {}\n\nextension P {\n public func index(after i: Int) -> Int { fatalError() }\n public var startIndex: Int { fatalError() }\n public var endIndex: Int { fatalError() }\n public subscript(index: Int) -> String { ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122586685.swift | rdar122586685.swift | Swift | 449 | 0.8 | 0 | 0.090909 | node-utils | 447 | 2024-03-04T19:48:15.846294 | GPL-3.0 | true | 0aaa6b2837a4c206b2ecc4059227db56 |
// RUN: %target-typecheck-verify-swift\n\npublic protocol P1 {\n associatedtype A\n func f() -> A\n}\n\npublic struct S1 {}\n\nextension Int: P1 {\n public func f() -> S1 { fatalError() }\n}\n\npublic protocol P2: RawRepresentable, P1 {}\n\npublic struct S2 {}\n\nextension P2 where RawValue == S2, A == S2 {\n // Th... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122586992.swift | rdar122586992.swift | Swift | 829 | 0.95 | 0 | 0.185185 | awesome-app | 716 | 2024-07-15T17:11:43.572517 | BSD-3-Clause | true | 3126c72f12cd3a5e4504d166389f0d21 |
// RUN: %target-typecheck-verify-swift\n\npublic struct S<Element: Hashable> {\n public typealias A = [Element: Int]\n}\n\nextension S: Sequence {\n public func makeIterator() -> A.Iterator {\n fatalError()\n }\n}\n\nlet x: (key: String, value: Int).Type = S<String>.Element.self | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122587432.swift | rdar122587432.swift | Swift | 273 | 0.8 | 0 | 0.1 | awesome-app | 540 | 2023-08-28T05:18:22.838919 | BSD-3-Clause | true | 6e619aa126dd50683a35c302194460f7 |
// RUN: %target-typecheck-verify-swift\n\nstruct S<Element> {}\n\nextension S: Sequence, IteratorProtocol {\n mutating func next() -> Element?? {\n fatalError()\n }\n}\n\nextension S: Collection {\n var startIndex: Int {\n fatalError()\n }\n\n var endIndex: Int {\n fatalError()\n }\n\n subscript(_ index... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122587920.swift | rdar122587920.swift | Swift | 450 | 0.8 | 0 | 0.045455 | awesome-app | 774 | 2025-02-09T16:21:16.116939 | Apache-2.0 | true | cee56c09cb276a0ad99bdc34e36035d3 |
// RUN: %target-typecheck-verify-swift\n\nstruct G<T> {\n class Nested {}\n}\n\nextension G.Nested: Sequence {\n func makeIterator() -> AnyIterator<String> { fatalError() }\n}\n\nextension G: LazySequenceProtocol, IteratorProtocol {\n mutating func next() -> Int? { fatalError() }\n}\n\nlet c: G<Float>.Type = G<Float... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122588328.swift | rdar122588328.swift | Swift | 476 | 0.95 | 0.055556 | 0.071429 | awesome-app | 700 | 2024-01-24T14:23:46.252691 | Apache-2.0 | true | 6cb895495bda9ae762bcf469257bded9 |
// RUN: %target-typecheck-verify-swift\n\nprotocol P1 {\n associatedtype A\n\n func f1(_: C) -> A\n func f2(_: A, _: C)\n\n typealias C = S1<Self>\n}\n\nstruct S1<T> {}\n\nprotocol P2: P1 where A == B {\n associatedtype B\n\n func g1(_: C) -> B\n func g2(_: B, _: C)\n}\n\nextension P2 {\n func f1(_: C) -> B { f... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122589094.swift | rdar122589094.swift | Swift | 462 | 0.8 | 0 | 0.04 | vue-tools | 753 | 2023-11-17T20:45:50.772213 | Apache-2.0 | true | e802f166762abac7f15002b2b39e6acd |
// RUN: %target-typecheck-verify-swift\n\npublic protocol P1 {\n associatedtype A = Void\n\n func makeA() -> A\n func consumeA(a: inout A)\n}\n\nextension P1 where A == Void {\n // Don't consider this witness in the 'S2: P1' conformance below.\n public func makeA() -> A { fatalError() }\n}\n\npublic stru... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122596633-1.swift | rdar122596633-1.swift | Swift | 868 | 0.8 | 0 | 0.058824 | node-utils | 801 | 2023-10-12T13:46:30.984105 | Apache-2.0 | true | 28bec0c56cb31c55621d65421edc18b5 |
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple\n\npublic protocol P<A> {\n associatedtype A\n associatedtype B: P\n\n func makeA() -> A\n var b: B { get }\n}\n\nextension P where A == B.A {\n public func makeA() -> B.A {\n fatalError()\n }\n}\n\npublic struct S: P {... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar122596633-2.swift | rdar122596633-2.swift | Swift | 598 | 0.8 | 0 | 0.04 | python-kit | 782 | 2024-10-10T17:38:17.275758 | Apache-2.0 | true | 0669eb9535ee73384e0874a45592996c |
// RUN: %target-typecheck-verify-swift\n\nstruct CustomCollection<T>: RandomAccessCollection {\n struct CustomIndices: RandomAccessCollection {\n var count: Int { fatalError() }\n\n var startIndex: Int { fatalError() }\n var endIndex: Int { fatalError() }\n\n subscript(index: Int) -> Int ... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123261282.swift | rdar123261282.swift | Swift | 656 | 0.8 | 0 | 0.0625 | node-utils | 122 | 2025-04-11T08:53:45.422990 | Apache-2.0 | true | 7b50c10c7e3c3d243fb65d074e5b69b8 |
// RUN: %target-typecheck-verify-swift\n\npublic protocol P {\n associatedtype A = Never\n}\n\npublic struct G<A>: P {}\n\npublic struct ConcreteA {}\n\npublic protocol Q: P where Self.A == ConcreteA {}\n\nextension G: Q where A == ConcreteA {}\n | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123262178.swift | rdar123262178.swift | Swift | 234 | 0.8 | 0 | 0.125 | awesome-app | 878 | 2025-04-07T13:58:52.005503 | Apache-2.0 | true | e825424796eeba47a8227e623809da2b |
// RUN: %target-typecheck-verify-swift\n\nfunc f<T: Sequence>(_: T) -> T.Element {}\n\nlet x: Int = f(CustomCollection<Int>())\n\nstruct CustomCollection<Element>: RandomAccessCollection, MutableCollection {\n typealias SubSequence = ArraySlice<Element>\n typealias Index = Int\n typealias Indices = Range<Int>\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123270042.swift | rdar123270042.swift | Swift | 698 | 0.8 | 0 | 0.05 | react-lib | 527 | 2025-05-27T01:14:27.036919 | BSD-3-Clause | true | 1781b7efa1311da8b08f2fa2985b9f38 |
// RUN: %target-typecheck-verify-swift\n\nprotocol Task1: AnyObject {\n}\n\nprotocol Task2: AnyObject {\n}\n\nclass TaskImpl : Task2 {\n}\n\nprotocol TaskResult {\n associatedtype Task\n\n var tasks: [Task] { get }\n\n func removeMatchedTask(_ task: Task)\n func match(_ task: Task) -> Bool\n}\n\nextension TaskResul... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123336457.swift | rdar123336457.swift | Swift | 573 | 0.95 | 0.060606 | 0.043478 | node-utils | 791 | 2025-02-23T07:44:40.061044 | MIT | true | 82bcebb8538f25386977259f7c476a6a |
// RUN: %target-swift-frontend -emit-silgen %s\n\npublic struct G<A, B, C>: P {\n public typealias D = G<A, C, B>\n public typealias E = G<A, S, C>\n public typealias F = G<A, B, S>\n}\n\npublic struct S {}\n\npublic protocol P {\n associatedtype A\n associatedtype B\n associatedtype C\n associatedtype D: P wher... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123339514.swift | rdar123339514.swift | Swift | 466 | 0.8 | 0 | 0.066667 | node-utils | 673 | 2025-02-09T18:03:43.734031 | GPL-3.0 | true | 73bf3c36383bc86282a85064a47d0be0 |
// RUN: %target-typecheck-verify-swift\n\nstruct G1<T> {}\n\nstruct G2<A, B>: AP {\n func f1(_: G1<(B) -> A>, _: G1<B>) -> G1<A> { fatalError() }\n func f2<C>(_: (A) -> C) -> G1<C> { fatalError() }\n}\n\nprotocol OP: EP {\n associatedtype L\n associatedtype R\n \n func f1(_: G1<L>, _: G1<R>) -> G1<A>\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123345520.swift | rdar123345520.swift | Swift | 531 | 0.8 | 0 | 0.05 | vue-tools | 914 | 2024-01-12T00:02:30.682297 | BSD-3-Clause | true | 76898c066827f7e6bc539bc0c0fa1598 |
// RUN: %target-typecheck-verify-swift\n\nextension LazySequenceProtocol {\n @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)\n func filtering(\n while predicate: @escaping (Self.Element) -> Bool\n ) -> some (Sequence<Self.Element> & LazySequenceProtocol) {\n LazyFilteringSequence(base: self, pred... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar123357062.swift | rdar123357062.swift | Swift | 743 | 0.8 | 0.035714 | 0.043478 | vue-tools | 37 | 2023-08-26T01:42:14.488938 | GPL-3.0 | true | bc7bf4f774170671d4d52e37fc262c28 |
// RUN: not %target-typecheck-verify-swift\n\n// This is highly invalid, so just don't crash.\n\nstruct G<T> {}\n\nextension G: Collection {\n typealias SubSequence = DoesNotExist\n typealias Index = DoesNotExist\n\n subscript(position: Index) -> Element { fatalError() }\n}\n\nextension G: BidirectionalCollection wh... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar127575477.swift | rdar127575477.swift | Swift | 341 | 0.8 | 0 | 0.222222 | awesome-app | 303 | 2024-08-30T11:41:02.620229 | BSD-3-Clause | true | 4f5f06970984e322505613b7cebc3640 |
// RUN: %target-typecheck-verify-swift\n\npublic typealias A = UInt32\n\npublic protocol P1: Numeric, Strideable, CustomStringConvertible\nwhere Magnitude == B.Magnitude,\n IntegerLiteralType == B.Magnitude,\n Stride == B.Stride {\n associatedtype B: BinaryInteger\n init(_ b: B)\n init(integerLiteral value... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\rdar90402522.swift | rdar90402522.swift | Swift | 2,003 | 0.8 | 0.009174 | 0.011905 | node-utils | 214 | 2024-11-10T04:55:44.538783 | MIT | true | 6e2d843f9c56f69b0dfafa40cae908e8 |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype E: Error\n var prop: Int { get throws(E) } // expected-note {{protocol requires property 'prop' with type 'Int'}}\n}\n\nstruct S0: P {\n var prop: Int {\n get {}\n }\n}\n\nstruct S1: P {\n var prop: Int {\n get throws(Never) {}\n }\n}\... | dataset_sample\swift\apple_swift\test\AssociatedTypeInference\typed_throws_getter.swift | typed_throws_getter.swift | Swift | 909 | 0.95 | 0.017544 | 0.065217 | react-lib | 157 | 2025-02-27T19:43:59.638371 | Apache-2.0 | true | 3eb4dd895794d0055955b2e034436b58 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-swift-frontend-dump-parse \\n// RUN: -enable-experimental-feature ABIAttribute \\n// RUN: -enable-experimental-feature Extern \\n// RUN: -enable-experimental-feature LifetimeDependence \\n// RUN: -enable-experimental-feature RawLayout \\n// RUN: -enable-experime... | dataset_sample\swift\apple_swift\test\ASTGen\attrs.swift | attrs.swift | Swift | 8,139 | 0.95 | 0.038168 | 0.209524 | react-lib | 101 | 2024-10-14T14:11:22.672234 | BSD-3-Clause | true | 9d04475dfa3788926fe443bb03e8bbee |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s %dump-parse -import-objc-header %S/Inputs/objc_decls.h -enable-experimental-feature ParserASTGen \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %s %dump-parse -... | dataset_sample\swift\apple_swift\test\ASTGen\attrs_objc.swift | attrs_objc.swift | Swift | 1,702 | 0.95 | 0.073171 | 0.333333 | node-utils | 321 | 2025-06-29T17:59:36.220191 | MIT | true | f8746d55179f333379b660d8ca282bb1 |
// RUN: %empty-directory(%t)\n\n// RUNx: %target-swift-frontend-dump-parse \\n// RUNx: -enable-experimental-feature ParserASTGen \\n// RUNx: | %sanitize-address > %t/astgen.ast\n\n// RUNx: %target-swift-frontend-dump-parse \\n// RUNx: | %sanitize-address > %t/cpp-parser.ast\n\n// RUNx: %diff -u %t/astgen.ast %t/c... | dataset_sample\swift\apple_swift\test\ASTGen\autodiff.swift | autodiff.swift | Swift | 3,523 | 0.95 | 0 | 0.173913 | python-kit | 156 | 2023-09-04T04:54:45.757127 | BSD-3-Clause | true | 05d2b32159d7d4c412db583a4bba7610 |
// RUN: %empty-directory(%t)\n\n// RUN: COMPILER_ARGS=( \\n// RUN: -define-availability '_iOS53Aligned:macOS 50.0, iOS 53.0' \\n// RUN: -define-availability '_iOS54Aligned:macOS 51.0, iOS 54.0' \\n// RUN: -define-availability '_iOS54:iOS 54.0' \\n// RUN: -define-availability '_macOS51_0:macOS 51.0' \\n// RUN: ... | dataset_sample\swift\apple_swift\test\ASTGen\availability.swift | availability.swift | Swift | 2,009 | 0.95 | 0.057971 | 0.431373 | vue-tools | 329 | 2023-12-16T12:07:29.599351 | GPL-3.0 | true | 0fa2422cf55f6d785cac3ae61d0f3fdc |
\n// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ParserASTGen \\n// RUN: -enable-experimental-feature CoroutineAccessors \\n// RUN: | %sanitize-address > %t/astgen.a... | dataset_sample\swift\apple_swift\test\ASTGen\decls.swift | decls.swift | Swift | 6,333 | 0.95 | 0.019663 | 0.090301 | python-kit | 693 | 2025-05-03T02:37:07.981876 | Apache-2.0 | true | 46a8c35c5d3929acc525d6d0bdb8d5e0 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-typecheck-verify-swift -disable-availability-checking -enable-bare-slash-regex -enable-experimental-feature ParserASTGen\n\n// REQUIRES: swift_swift_parser\n// REQUIRES: swift_feature_ParserASTGen\n// rdar://116686158\n// UNSUPPORTED: asan\n\nfunc testRegexLiteral() {\n ... | dataset_sample\swift\apple_swift\test\ASTGen\diagnostics.swift | diagnostics.swift | Swift | 2,596 | 0.95 | 0.102941 | 0.384615 | python-kit | 461 | 2025-07-08T12:58:54.092686 | BSD-3-Clause | true | ad7f4d147419e10d776a2450661a7ea7 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-feature DoExpressions -enable-experimental-feature ParserASTGen \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable... | dataset_sample\swift\apple_swift\test\ASTGen\do_expr.swift | do_expr.swift | Swift | 942 | 0.8 | 0.083333 | 0.666667 | awesome-app | 182 | 2025-06-04T10:33:51.524509 | MIT | true | cfef036004245c14c7d8e488d8787bd4 |
// **Copied from test/embedded/availability.swift**\n// RUN: %target-typecheck-verify-swift -parse-stdlib -enable-experimental-feature Embedded -enable-experimental-feature ParserASTGen\n\n// REQUIRES: swift_in_compiler\n// REQUIRES: swift_feature_Embedded\n// REQUIRES: swift_feature_ParserASTGen\n\n@_unavailableInEmbe... | dataset_sample\swift\apple_swift\test\ASTGen\embedded_availability.swift | embedded_availability.swift | Swift | 3,916 | 0.8 | 0 | 0.12 | vue-tools | 477 | 2024-05-14T00:28:49.828227 | MIT | true | b05f6a5d074f5335b4cc35295acb3b01 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend-dump-parse -target %target-swift-5.1-abi-triple -enable-experimental-move-only -enable-experimental-feature ParserASTGen \\n// RUN: -enable-experimental-feature OldOwnershipOperatorSpellings \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-... | dataset_sample\swift\apple_swift\test\ASTGen\exprs.swift | exprs.swift | Swift | 5,352 | 0.95 | 0.04721 | 0.079602 | python-kit | 745 | 2024-09-04T16:47:02.577324 | MIT | true | 16fce27bf12d995a89ff2a53379e0612 |
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ParserASTGen -DDISCARDABLE -DNONSENDABLE -swift-version 6\n\n// REQUIRES: swift_feature_ParserASTGen\n\n#if NOT_SET\nfunc f { } // expected-error{{expected parameter clause in function signature}}\n // expected-note@-1{{insert parameter claus... | dataset_sample\swift\apple_swift\test\ASTGen\if_config.swift | if_config.swift | Swift | 1,232 | 0.95 | 0.142857 | 0.388889 | node-utils | 938 | 2023-10-21T18:59:57.187898 | MIT | true | 22c5d4c547f07f2a38d28bd56b8075a3 |
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ParserASTGen -D CONDITION_1\n\n// REQUIRES: swift_swift_parser\n// REQUIRES: swift_feature_ParserASTGen\n\npostfix operator ++\npostfix func ++ (_: Int) -> Int { 0 }\n\nstruct OneResult {}\nstruct TwoResult {}\n\nprotocol MyProto {\n func optionalMe... | dataset_sample\swift\apple_swift\test\ASTGen\if_config_expr.swift | if_config_expr.swift | Swift | 3,248 | 0.8 | 0.123077 | 0.414414 | react-lib | 491 | 2024-11-20T19:51:11.283499 | Apache-2.0 | true | 36857ebfcb7d2a5350b98eac1c6dbedc |
// REQUIRES: swift_swift_parser\n// REQUIRES: swift_feature_ParserASTGen\n\n// NOTE: Comparing -dump-ast instead of -dump-parse because ASTGen generates\n// KeyPathExpr differently. In C++ parser the root expression is parsed as a\n// normal expression, but in SwiftParser it's parsed as a TypeSyntax, so ASTGen\n// gen... | dataset_sample\swift\apple_swift\test\ASTGen\keypath.swift | keypath.swift | Swift | 9,470 | 0.8 | 0.008097 | 0.154639 | node-utils | 44 | 2024-06-13T08:53:57.109623 | MIT | true | 26014224263576285ed0283c61d3eed6 |
// REQUIRES: swift_swift_parser, asserts\n// REQUIRES: swift_feature_ParserASTGen\n\n// RUN: %empty-directory(%t)\n\n// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/../Macros/Inputs/syntax_macro_definitions.swift\n\n// RUN: %target-typ... | dataset_sample\swift\apple_swift\test\ASTGen\macros.swift | macros.swift | Swift | 4,157 | 0.95 | 0.025806 | 0.075 | vue-tools | 58 | 2025-03-10T02:08:07.939000 | GPL-3.0 | true | e57adab12857e36dfb3d5f69ce6c5e38 |
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ParserASTGen\n// REQUIRES: OS=macosx\n// REQUIRES: swift_swift_parser\n// REQUIRES: swift_feature_ParserASTGen\n\nstruct S: _ExpressibleByColorLiteral {\n init(_colorLiteralRed: Float, green: Float, blue: Float, alpha: Float) {}\n}\n\nlet y: S = #colo... | dataset_sample\swift\apple_swift\test\ASTGen\object_literals.swift | object_literals.swift | Swift | 1,702 | 0.95 | 0 | 0.37037 | python-kit | 305 | 2023-11-04T17:16:25.782594 | BSD-3-Clause | true | 9cf0985e7a4d4987a7ef7dbd3c26b231 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend-dump-parse -enable-experimental-feature ParserASTGen \\n// RUN: -enable-experimental-feature StaticAssert \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-dump-parse \\n// RUN: -enable-experimental-feature StaticAssert \\n/... | dataset_sample\swift\apple_swift\test\ASTGen\pound_assert.swift | pound_assert.swift | Swift | 801 | 0.8 | 0 | 0.882353 | node-utils | 286 | 2023-12-01T15:03:14.995288 | Apache-2.0 | true | a6eaae7f95aae242e014a46d731b82ea |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend-dump-parse -enable-bare-slash-regex -disable-availability-checking -enable-experimental-feature ParserASTGen \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-dump-parse -enable-bare-slash-regex -disable-availability-checking \... | dataset_sample\swift\apple_swift\test\ASTGen\regex.swift | regex.swift | Swift | 961 | 0.8 | 0 | 0.44 | python-kit | 620 | 2025-05-20T19:34:24.372607 | GPL-3.0 | true | d2fdf413af98cfd0810d219f8162fcad |
func test(arg: Int) -> Int { 1 }\n\nfunc foo() {\n #sourceLocation(file: "first/foo.swift", line: 100)\n test(arg: 1)\n}\n\nfunc bar() {\n #sourceLocation(file: "second/foo.swift", line: 100)\n}\n\ntest(arg: 2)\n\n// RUN: %target-swift-frontend -emit-silgen -module-name MyMod %s -enable-experimental-feature ParserAS... | dataset_sample\swift\apple_swift\test\ASTGen\sourcelocation.swift | sourcelocation.swift | Swift | 1,905 | 0.8 | 0 | 0.758621 | node-utils | 51 | 2024-12-22T09:04:59.605323 | BSD-3-Clause | true | e1ba8f927d529102b0a2c77ea9305cc9 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-feature ThenStatements -enable-experimental-feature ParserASTGen \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-dump-parse -disabl... | dataset_sample\swift\apple_swift\test\ASTGen\stmts.swift | stmts.swift | Swift | 3,066 | 0.8 | 0.104575 | 0.121212 | vue-tools | 345 | 2024-11-28T02:27:24.757427 | BSD-3-Clause | true | f1e99c4a2166d3affea250619b1abcf6 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-feature ParserASTGen \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experiment... | dataset_sample\swift\apple_swift\test\ASTGen\top_level.swift | top_level.swift | Swift | 1,171 | 0.8 | 0.027027 | 0.538462 | node-utils | 265 | 2025-05-19T22:20:26.415099 | BSD-3-Clause | true | 581b599ae3029bb1832ce80218760335 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-swift-frontend-dump-parse -enable-experimental-feature ParserASTGen \\n// RUN: -enable-experimental-feature NamedOpaqueTypes \\n// RUN: -enable-experimental-feature InlineArrayTypeSugar \\n// RUN: | %sanitize-address > %t/astgen.ast\n// RUN: %target-swift-frontend-d... | dataset_sample\swift\apple_swift\test\ASTGen\types.swift | types.swift | Swift | 2,400 | 0.95 | 0.032258 | 0.263889 | vue-tools | 253 | 2023-12-02T04:27:44.582323 | MIT | true | e0e70c73ded332da4ce59e46a5e8c13a |
// RUN: %target-typecheck-verify-swift -package-name myPkg\n\n// CHECK PARSING\nprivate // expected-note {{modifier already specified here}}\nprivate // expected-error {{duplicate modifier}}\nfunc duplicateAttr() {}\n\nprivate // expected-note {{previous modifier specified here}}\npublic // expected-error {{multiple in... | dataset_sample\swift\apple_swift\test\attr\accessibility.swift | accessibility.swift | Swift | 17,199 | 0.95 | 0.005831 | 0.024735 | vue-tools | 15 | 2023-11-20T15:56:46.919940 | BSD-3-Clause | true | 6ae650399c121237cf044f4b0c7cebd6 |
// RUN: %empty-directory(%t)\n// RUN: %{python} %utils/split_file.py -o %t %s\n// RUN: %target-swift-frontend -typecheck %t/file1.swift -primary-file %t/file2.swift -verify\n\n// BEGIN file1.swift\nprivate protocol P {\n func privMethod()\n}\npublic class C : P {\n public init() {}\n fileprivate func privMethod() {... | dataset_sample\swift\apple_swift\test\attr\accessibility_multifile.swift | accessibility_multifile.swift | Swift | 524 | 0.95 | 0.052632 | 0.294118 | python-kit | 67 | 2023-11-02T08:09:54.780105 | GPL-3.0 | true | 2cc83ecd75862f6bf406841f23a89f82 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -print-access -source-filename=%s | %FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-SRC\n// RUN: %target-swift-frontend -emit-module-path %t/accessibility_print.swiftmodule %s\n// RUN: %target-swift-ide-test -sk... | dataset_sample\swift\apple_swift\test\attr\accessibility_print.swift | accessibility_print.swift | Swift | 11,818 | 0.95 | 0.06117 | 0.433333 | vue-tools | 846 | 2024-10-26T20:34:36.914721 | BSD-3-Clause | true | 2810c62d21219c69e83bdf36c80db104 |
// RUN: %empty-directory(%t)\n\n// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -print-access -source-filename=%s -swift-version 4| %FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s\n// RUN: %target-swift-frontend -emit-module-path %t/accessibility_print.swiftmodule -module-name accessibi... | dataset_sample\swift\apple_swift\test\attr\accessibility_print_inferred_type_witnesses.swift | accessibility_print_inferred_type_witnesses.swift | Swift | 2,682 | 0.95 | 0.097561 | 0.5 | awesome-app | 766 | 2024-11-27T08:58:31.121484 | BSD-3-Clause | true | eff45fb9d5f9de67f3e0b5ef4fe66b9d |
// RUN: %target-typecheck-verify-swift -package-name myPkg\n// RUN: %target-swift-frontend -typecheck -disable-access-control -package-name myPkg %s\n\npublic protocol ProtoWithReqs {\n associatedtype AssocA // expected-note * {{type declared here}}\n associatedtype AssocB // expected-note * {{type declared here}}\n ... | dataset_sample\swift\apple_swift\test\attr\accessibility_proto.swift | accessibility_proto.swift | Swift | 16,140 | 0.95 | 0.0369 | 0.369919 | node-utils | 264 | 2024-12-08T09:45:44.603194 | GPL-3.0 | true | 500354c51b09ba14c07c34c6bafb7a89 |
// RUN: %target-typecheck-verify-swift -package-name myPkg\n\npublic class OuterClass {\n class InnerClass {}\n package class PkgInnerClass {}\n}\n\npublic protocol PublicProto2 {\n associatedtype T\n associatedtype U\n}\n\npackage class PkgOuterClass {\n class InnerClass {}\n}\n\npackage protocol PackageProto {\n... | dataset_sample\swift\apple_swift\test\attr\accessibility_where_clause.swift | accessibility_where_clause.swift | Swift | 2,224 | 0.95 | 0.152542 | 0.25 | awesome-app | 862 | 2025-04-01T00:02:23.625833 | MIT | true | 808046fffdaedb461977446f0d51a297 |
// RUN: %target-typecheck-verify-swift -enable-objc-interop\n\n@unknown func f0() {} // expected-error{{unknown attribute 'unknown'}}\n@unknown(x,y) func f1() {} // expected-error{{unknown attribute 'unknown'}}\n\nenum binary { \n case Zero\n case One\n init() { self = .Zero }\n}\n\nfunc f5(x: inout binary) {}\n\n//... | dataset_sample\swift\apple_swift\test\attr\attributes.swift | attributes.swift | Swift | 15,667 | 0.95 | 0.116711 | 0.066225 | node-utils | 616 | 2024-11-24T06:25:51.142797 | GPL-3.0 | true | 05426e3959b675272315f5c811bfe694 |
// RUN: %target-typecheck-verify-swift -enable-experimental-feature ABIAttribute -parse-as-library\n\n// REQUIRES: swift_feature_ABIAttribute\n// REQUIRES: objc_interop\n\nimport Foundation\n\n// @NSCopying -- banned in @abi\nclass NSCopyingAttr: NSObject {\n @abi(@NSCopying var v1: NSArray?) // expected-error {{unuse... | dataset_sample\swift\apple_swift\test\attr\attr_abi_objc.swift | attr_abi_objc.swift | Swift | 5,139 | 0.95 | 0.070513 | 0.142857 | vue-tools | 954 | 2025-05-27T04:55:03.569363 | BSD-3-Clause | true | a5c0a0db2bef2074011437800165cb10 |
// RUN: %target-swift-frontend -enable-experimental-feature AddressableParameters -typecheck %s -verify\n// REQUIRES: swift_feature_AddressableParameters\n\nfunc foo(_: @_addressable String) {}\n\nfunc bar(_: (@_addressable String) -> Void) {}\n\nfunc bas(_: @convention(c) (@_addressable String) -> Void) {} // expected... | dataset_sample\swift\apple_swift\test\attr\attr_addressable.swift | attr_addressable.swift | Swift | 600 | 0.95 | 0.071429 | 0.222222 | python-kit | 9 | 2025-02-01T14:25:49.380080 | MIT | true | f88427ec0a9e2e5ec47a00d5c1f78734 |
// RUN: %target-typecheck-verify-swift\n\n@_alignment(16)\nstruct Float4 {\n var x, y, z, w: Float\n}\n@_alignment(1)\nstruct AnyAlignment {}\n@_alignment(1)\nenum AnyAlignmentEnum {}\n\n\n@_alignment // expected-error{{expected '('}}\nstruct DidntSpecifyAlignment {}\n\n@_alignment() // expected-error{{must be a posit... | dataset_sample\swift\apple_swift\test\attr\attr_alignment.swift | attr_alignment.swift | Swift | 1,491 | 0.95 | 0.023256 | 0.032258 | react-lib | 141 | 2025-03-23T06:17:53.178064 | GPL-3.0 | true | dbac7220c2bf8237ea64068ddd1266fc |
// RUN: %target-typecheck-verify-swift\n\nprivate func privateFunction() {}\n// expected-note@-1{{global function 'privateFunction()' is not '@usableFromInline' or public}}\nfileprivate func fileprivateFunction() {}\n// expected-note@-1{{global function 'fileprivateFunction()' is not '@usableFromInline' or public}}\nfu... | dataset_sample\swift\apple_swift\test\attr\attr_alwaysEmitIntoClient.swift | attr_alwaysEmitIntoClient.swift | Swift | 1,787 | 0.95 | 0.311111 | 0.108108 | python-kit | 764 | 2024-08-16T19:43:33.624976 | BSD-3-Clause | true | 25a40fea9e1346a81db81dd296611abd |
// RUN: %target-typecheck-verify-swift -swift-version 5\n\n// Simple case.\nvar fn : @autoclosure () -> Int = 4 // expected-error {{'@autoclosure' may only be used on parameters}}\n\n@autoclosure func func1() {} // expected-error {{attribute can only be applied to types, not declarations}}\n\nfunc func1a(_ v1 : @auto... | dataset_sample\swift\apple_swift\test\attr\attr_autoclosure.swift | attr_autoclosure.swift | Swift | 12,827 | 0.95 | 0.035714 | 0.144 | awesome-app | 783 | 2025-02-10T13:10:54.811819 | Apache-2.0 | true | 8afc91f5854f8601ce20aa6468715dd2 |
// RUN: %target-typecheck-verify-swift -module-name Test\n\n@available(*, unavailable)\nfunc unavailable_func() {}\n\n@available(*, unavailable, message: "message")\nfunc unavailable_func_with_message() {}\n\n@available(tvOS, unavailable)\n@available(watchOS, unavailable)\n@available(iOS, unavailable)\n@available(OSX, ... | dataset_sample\swift\apple_swift\test\attr\attr_availability.swift | attr_availability.swift | Swift | 91,875 | 0.75 | 0.061364 | 0.051823 | python-kit | 4 | 2024-03-01T03:46:41.269825 | Apache-2.0 | true | 816562bdb928ea27cf953fe29221c300 |
// Verify that declarations unavailable to application extensions are diagnosed\n// as unavailable when compiling with `-application-extension`\n// RUN: %target-typecheck-verify-swift -application-extension\n\n// Remove `-application-extension` and verify no errors are emitted.\n// RUN: %target-swift-frontend -typechec... | dataset_sample\swift\apple_swift\test\attr\attr_availability_appext_unavailable.swift | attr_availability_appext_unavailable.swift | Swift | 918 | 0.8 | 0.052632 | 0.4 | vue-tools | 359 | 2023-11-01T00:28:43.599598 | BSD-3-Clause | true | 4329758e5288265e18793c8b07fd7efd |
// REQUIRES: concurrency\n// REQUIRES: objc_interop\n\n// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -I %S/Inputs/custom-modules\n// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -parse-as-library -I %S/Inputs/custom-modules\n\nimport ObjcAsync\n\n// The following should match to a correspo... | dataset_sample\swift\apple_swift\test\attr\attr_availability_async_rename.swift | attr_availability_async_rename.swift | Swift | 17,418 | 0.95 | 0.107062 | 0.231844 | awesome-app | 811 | 2023-08-16T02:17:46.678648 | GPL-3.0 | true | 2717fe948dc50b8a7867a3271e9f99f9 |
// REQUIRES: concurrency\n\n// RUN: %target-typecheck-verify-swift\n\nif #available(SwiftStdlib 5.5, *) {\n @available(*, renamed: "process(data:)")\n func process(data: [Int], completion: @escaping ([Int]) -> Void) { completion(data) }\n // expected-note@+1{{'process(data:)' declared here}}\n func process(data: [I... | dataset_sample\swift\apple_swift\test\attr\attr_availability_async_rename_toplevel.swift | attr_availability_async_rename_toplevel.swift | Swift | 669 | 0.95 | 0.090909 | 0.222222 | react-lib | 292 | 2024-01-12T13:23:10.486510 | BSD-3-Clause | true | 291b329c2fe7b2e984c83776cb70fbb2 |
// RUN: %swift -typecheck -verify -parse-stdlib -module-name Swift -target x86_64-apple-macosx11.0 %s\n\n\n@available(OSX, introduced: 10.5, deprecated: 10.8, obsoleted: 11.0,\n message: "you don't want to do that anyway")\nfunc obsoletedIn11() { }\n// expected-note @-1{{'obsoletedIn11()' was obsoleted in ... | dataset_sample\swift\apple_swift\test\attr\attr_availability_canonical_macos_version.swift | attr_availability_canonical_macos_version.swift | Swift | 1,499 | 0.8 | 0 | 0.111111 | python-kit | 52 | 2023-11-03T11:01:56.683944 | MIT | true | 27210883fa60a54c372ffde262ddfc3d |
// RUN: %swift -typecheck -verify -parse-stdlib -module-name Swift -target x86_64-apple-macosx10.15 %s\n\n@available(OSX, introduced: 10.16)\nfunc longFormIntroducedIn10_16() { }\n\n@available(OSX, introduced: 10.18)\nfunc longFormIntroducedIn10_18() { }\n\n@available(OSX, introduced: 11.0)\nfunc longFormIntroducedIn11... | dataset_sample\swift\apple_swift\test\attr\attr_availability_canonical_macos_version_introduction.swift | attr_availability_canonical_macos_version_introduction.swift | Swift | 2,384 | 0.95 | 0.163934 | 0.404255 | vue-tools | 442 | 2025-03-09T15:06:56.945549 | BSD-3-Clause | true | c259c9aec677d049fe1be55c96297f04 |
// RUN: %swift -typecheck -verify -parse-stdlib -module-name Swift -target x86_64-apple-macosx10.15 %s -application-extension\n\n@available(OSXApplicationExtension 11, *)\nfunc introducedInAppExtension11_0() { }\n\n@available(OSXApplicationExtension 10.16, *)\nfunc useAppExtension() {\n introducedInAppExtension11_0() ... | dataset_sample\swift\apple_swift\test\attr\attr_availability_canonical_macos_version_introduction_appext.swift | attr_availability_canonical_macos_version_introduction_appext.swift | Swift | 329 | 0.8 | 0 | 0.142857 | node-utils | 574 | 2024-12-19T12:48:55.647525 | BSD-3-Clause | true | e7eec858d8831179f585a9c0f702754b |
// RUN: %target-typecheck-verify-swift \\n// RUN: -enable-experimental-feature CustomAvailability \\n// RUN: -define-enabled-availability-domain EnabledDomain \\n// RUN: -define-enabled-availability-domain RedefinedDomain \\n// RUN: -define-disabled-availability-domain DisabledDomain \\n// RUN: -define-dynamic-ava... | dataset_sample\swift\apple_swift\test\attr\attr_availability_custom_domains.swift | attr_availability_custom_domains.swift | Swift | 2,971 | 0.8 | 0.081967 | 0.27907 | python-kit | 214 | 2024-11-06T16:14:14.758251 | Apache-2.0 | true | d5655ae551ab601dbf013d69b9b6f0cd |
// RUN: %target-typecheck-verify-swift \\n// RUN: -define-enabled-availability-domain SomeDomain\n\n@available(SomeDomain, unavailable) // expected-error {{SomeDomain requires '-enable-experimental-feature CustomAvailability'}}\nfunc availableInSomeDomain() { }\n\nif #available(SomeDomain) {} // expected-error {{SomeD... | dataset_sample\swift\apple_swift\test\attr\attr_availability_custom_domains_experimental_feature_required.swift | attr_availability_custom_domains_experimental_feature_required.swift | Swift | 568 | 0.95 | 0.333333 | 0.428571 | node-utils | 585 | 2025-07-09T07:07:40.329886 | GPL-3.0 | true | 5e1b7932a1e13979999a54738b11be29 |
// RUN: %swift -typecheck -verify -parse-stdlib -target %target-cpu-apple-ios51.0-macabi %s\n\n// REQUIRES: OS=macosx || OS=maccatalyst\n\n@available(macCatalyst, introduced: 1.0, deprecated: 2.0, obsoleted: 9.0,\n message: "you don't want to do that anyway")\nfunc obsoletedOnMacCatalyst() { }\n// expected-no... | dataset_sample\swift\apple_swift\test\attr\attr_availability_maccatalyst.swift | attr_availability_maccatalyst.swift | Swift | 10,580 | 0.95 | 0.100719 | 0.126168 | node-utils | 607 | 2024-11-05T21:11:20.402952 | BSD-3-Clause | true | 38b3b000b3ca694968a3c3b3e92398f2 |
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macos10.15\n// REQUIRES: OS=macosx\n// <rdar://problem/17669805> Suggest narrowing the range of bad availabile checks\n\nimport Foundation\n\n@available(macOS 50.2, *)\nfunc foo() { }\n\nfunc useFoo() {\n if #available(macOS 50.1, *) {\n foo() // expe... | dataset_sample\swift\apple_swift\test\attr\attr_availability_narrow.swift | attr_availability_narrow.swift | Swift | 2,829 | 0.95 | 0.207921 | 0.119048 | python-kit | 347 | 2024-05-02T19:26:21.592407 | BSD-3-Clause | true | 771a6804f22dbbb64ce58a2826b38dfe |
// RUN: %target-typecheck-verify-swift\n\n// REQUIRES: concurrency\n\n\n@available(*, noasync)\nfunc basicNoAsync() { }\n\n@available(*, noasync, message: "a message from the author")\nfunc messageNoAsync() { }\n\n@available(*, noasync, renamed: "asyncReplacement()")\nfunc renamedNoAsync(_ completion: @escaping (Int) -... | dataset_sample\swift\apple_swift\test\attr\attr_availability_noasync.swift | attr_availability_noasync.swift | Swift | 5,646 | 0.95 | 0.090909 | 0.153846 | node-utils | 257 | 2023-08-18T18:24:41.072854 | Apache-2.0 | true | 7ee8de3da9768e844f6f1764a7dd1012 |
// RUN: %target-typecheck-verify-swift\n\n// REQUIRES: objc_interop\n\n@objc\nprotocol OlfactoryProtocol {\n @available(*, unavailable)\n func bad() // expected-note {{here}}\n @available(*, unavailable, message: "it was smelly")\n func smelly() // expected-note {{here}}\n @available(*, unavailable, renamed: "new"... | dataset_sample\swift\apple_swift\test\attr\attr_availability_objc.swift | attr_availability_objc.swift | Swift | 9,922 | 0.95 | 0.055901 | 0.036765 | react-lib | 501 | 2023-07-16T14:46:12.956033 | MIT | true | 498a5fc4fb6aca702bfee9c950ebd9d6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.