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-swift-frontend %s -emit-ir\n\nstruct MySlice<Base : MyIndexableType> : MyCollectionType {}\nstruct MyMutableSlice<Base : MyMutableCollectionType> : MyMutableCollectionType {}\n\nprotocol MySequenceType {}\nprotocol MyIndexableType {}\n\nprotocol MyCollectionType : MySequenceType, MyIndexableType {\n as... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0042-rdar21775089.swift | 0042-rdar21775089.swift | Swift | 777 | 0.8 | 0 | 0.041667 | node-utils | 652 | 2025-01-04T00:05:36.773778 | MIT | true | 1fe0e8eaa9b4bcbd81d9824530bc532e |
// RUN: %target-swift-frontend %s -typecheck\n\npublic protocol P1 {\n associatedtype A1\n}\n\npublic protocol P2 : P1 {\n associatedtype A2 : P1\n var prop1: A2 { get }\n}\n\nextension P2 {\n public typealias A1 = A2\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0043-rdar25298116.swift | 0043-rdar25298116.swift | Swift | 212 | 0.8 | 0 | 0.090909 | vue-tools | 817 | 2023-12-25T22:02:40.683532 | GPL-3.0 | true | 87215d1c048a9c75ba038f188e5e968b |
// RUN: not %target-swift-frontend %s -emit-silgen\n\nenum X {\n init?(a: Int) {\n .p[a]\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0044-enum-dot-crash.swift | 0044-enum-dot-crash.swift | Swift | 103 | 0.8 | 0 | 0.166667 | node-utils | 404 | 2023-10-07T14:29:14.312125 | MIT | true | cc3f8400a5284effe7cc842da031fcc9 |
// RUN: %target-swift-frontend %s -parse -emit-silgen\n\n// https://github.com/apple/swift/issues/45855\n\nlet function: () -> Any = { () -> Void in }\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0045-issue-45855.swift | 0045-issue-45855.swift | Swift | 147 | 0.95 | 0.2 | 0.666667 | awesome-app | 550 | 2025-04-12T10:12:22.795462 | Apache-2.0 | true | e681ed70d6f26b733f8c6dd979a24eae |
// RUN: not %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/45942\n\nclass A {\n class T {\n class b: Array<T> {\n\n }\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0046-recursive-generic-arg-in-inherited-clause.swift | 0046-recursive-generic-arg-in-inherited-clause.swift | Swift | 155 | 0.95 | 0.272727 | 0.25 | python-kit | 922 | 2023-12-18T09:19:49.492919 | MIT | true | 7c28e4b5f61044e8f18225bbfb916e8e |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/43915\n\nenum SampleType: UInt8 {\n case Value = 1\n case Array\n case Dictionary\n}\n\nprotocol ByteConvertible {\n init?(bytes: [UInt8], startOffset: Int)\n func rawBytes() -> [UInt8]\n func bytesNeeded() -> Int\n... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0047-issue-43915.swift | 0047-issue-43915.swift | Swift | 1,008 | 0.8 | 0 | 0.051282 | react-lib | 347 | 2023-11-27T04:54:05.283814 | BSD-3-Clause | true | ebcd97ed8d00cf747499fd4ab4cb3efc |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/44940\n\npublic protocol Proto {\n associatedtype One\n associatedtype Two\n\n static func bar<T>(elm: One, t: T) -> T\n}\n\nstruct S<P: Proto> {\n let x: P.Two\n func foo<T>(_ t: T) -> T where P.Two == P.One {\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0048-issue-44940.swift | 0048-issue-44940.swift | Swift | 412 | 0.8 | 0 | 0.133333 | react-lib | 138 | 2024-02-01T15:17:40.525213 | MIT | true | 4fc1024e94dd5f7f52646ec580b87369 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/45216\n\nprotocol Foo {\n associatedtype A\n var value: A { get }\n init(_ v: A)\n}\nextension Foo {\n init<T>(pairing other: T)\n where\n T: Foo,\n Self.A == (T.A, T.A) // <-- Look at this, and then ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0049-issue-45216.swift | 0049-issue-45216.swift | Swift | 557 | 0.8 | 0 | 0.111111 | node-utils | 697 | 2025-03-28T06:35:49.535918 | BSD-3-Clause | true | ed725affd56baa3badf5263a7e5c788d |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/45747\n\npublic class Entity{\n}\npublic class DataCollection<T>{\n}\npublic protocol IEntityCollection : class{\n func AddEntity(_ entity:Entity)\n}\npublic class EntityCollection<T:Entity> : DataCollection<T>, IEntityCollection{\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0050-issue-45747.swift | 0050-issue-45747.swift | Swift | 560 | 0.95 | 0.277778 | 0.125 | awesome-app | 251 | 2025-02-01T06:31:54.254323 | MIT | true | 23757266878b0c3f3f86780deef3bd62 |
// RUN: %target-swift-frontend %s -emit-silgen\n\n// https://github.com/apple/swift/issues/45800\n\nprotocol CType {\n init()\n}\n\nprotocol BType {\n associatedtype C: CType\n}\n\nprotocol A {\n associatedtype B: BType\n typealias C = B.C\n}\n\nfunc test<T: A>(_ a: T) -> T.C {\n return T.C()\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0051-issue-45800.swift | 0051-issue-45800.swift | Swift | 293 | 0.8 | 0 | 0.133333 | node-utils | 499 | 2025-04-18T20:15:01.345347 | BSD-3-Clause | true | 5d95842c8a83f51a69a932167c46fa72 |
// RUN: %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/46066\n\nprotocol P {\n associatedtype A\n}\n\nstruct S : P {\n typealias A = Gen<S>\n}\n\nstruct Gen<T: P> {}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0052-issue-46066.swift | 0052-issue-46066.swift | Swift | 190 | 0.8 | 0 | 0.222222 | react-lib | 577 | 2023-10-22T04:17:42.538904 | Apache-2.0 | true | 433de9347c02ece599637f4f927912ee |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/43107\n\nenum Value {\n case IntValue(Int)\n}\n\nprotocol Storable {\n associatedtype Representation\n \n static var storageKey : String? { get }\n var representation : Representation { get }\n}\n\nprotocol RawProducab... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0053-issue-43107.swift | 0053-issue-43107.swift | Swift | 568 | 0.8 | 0 | 0.111111 | awesome-app | 695 | 2023-08-10T15:52:55.005828 | GPL-3.0 | true | 9c6a9e4fd1a899642d1db7f2c379a857 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/43445\n\npublic class A <T> {\n public init() {}\n}\n\npublic class B : A <B.C> {\n public struct C { }\n public override init() {}\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0054-issue-43445.swift | 0054-issue-43445.swift | Swift | 220 | 0.95 | 0.166667 | 0.222222 | node-utils | 24 | 2025-06-24T21:07:50.747157 | Apache-2.0 | true | 3658404002d4650d746123df9ef54df1 |
// RUN: not %target-swift-frontend %s -typecheck\n//\n// REQUIRES: objc_interop\n\n// https://github.com/apple/swift/issues/45725\n\nimport Foundation\n\nclass GenericClass<T>: NSObject {\n var someVar = [String: UndefinedClass]()\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0055-issue-45725.swift | 0055-issue-45725.swift | Swift | 227 | 0.95 | 0.090909 | 0.5 | node-utils | 351 | 2024-09-25T00:48:28.466104 | GPL-3.0 | true | 8550372b258d590d3668685752a7230b |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/45914\n\nextension Collection where Self.Iterator.Element: Equatable {\n func count<T: Equatable>(of element: T) -> Int where T == Self.Iterator.Element {\n return self.reduce(0) {\n sum, e in\n let isSame: Int = (e == ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0056-issue-45914.swift | 0056-issue-45914.swift | Swift | 367 | 0.8 | 0 | 0.181818 | python-kit | 880 | 2024-11-02T04:22:16.326598 | Apache-2.0 | true | 359906a2109e04de234e27a946ca40a7 |
// RUN: %target-swift-frontend %s -emit-ir\n\nprotocol P {\n associatedtype A\n func f()\n}\n\nextension P where A == Int {\n func f() {\n print("cool")\n }\n}\nextension P {\n func f() { print("semi-uncool") }\n func g() {\n f()\n }\n}\nstruct X<T> : P {\n typealias A = T\n}\n\nextension X where A == Int... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0057-rdar29587093.swift | 0057-rdar29587093.swift | Swift | 366 | 0.8 | 0 | 0.038462 | vue-tools | 31 | 2024-07-07T00:02:22.904895 | Apache-2.0 | true | c7bcdb949ff3f1c86d512e953d96e94b |
// RUN: %target-swift-frontend %s -emit-ir\n\nextension Array where Iterator.Element == UTF8.CodeUnit {\n var u8str : String {\n return ""\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0058-rdar29223240.swift | 0058-rdar29223240.swift | Swift | 145 | 0.8 | 0 | 0.166667 | react-lib | 933 | 2023-12-01T18:11:03.585428 | Apache-2.0 | true | c6e577f2c56bd1a32b29a458b35f5807 |
// RUN: %target-swift-frontend %s -emit-ir\n// RUN: %target-swift-frontend %s -emit-ir -O\n\n// https://github.com/apple/swift/issues/45909\n\nprotocol ControllerB {\n associatedtype T: Controller\n}\n\nprotocol Controller {\n associatedtype T\n\n func shouldSelect<S: ControllerB>(_ a: T, b: S) where S.T == Se... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0059-issue-45909.swift | 0059-issue-45909.swift | Swift | 946 | 0.8 | 0 | 0.107143 | node-utils | 959 | 2024-08-14T01:51:30.557883 | BSD-3-Clause | true | 2865acb497a24e1c795531564f763a66 |
// RUN: %target-swift-frontend %s -emit-ir\n// RUN: %target-swift-frontend %s -emit-ir -O\n\n// REQUIRES: objc_interop\n\n// https://github.com/apple/swift/issues/45306\n\nimport Foundation\n\n/// This function returns true if inspectedClass is subclass of wantedSuperclass.\n/// This is achieved by climbing the class t... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0060-issue-45306.swift | 0060-issue-45306.swift | Swift | 2,168 | 0.95 | 0.220588 | 0.346154 | node-utils | 17 | 2025-05-30T10:54:28.967512 | BSD-3-Clause | true | 8e5d6166067caf12e8a194ba5eb076c2 |
// RUN: %target-swift-frontend %s -emit-silgen\n\n// https://github.com/apple/swift/issues/45761\n\nprotocol P: Equatable, ExpressibleByStringLiteral {\n var uid: String { get }\n init(uid: String)\n}\n\nextension P {\n // Equatable\n public static func ==(lhs: Self, rhs: Self) -> Bool {\n return lhs... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0061-issue-45761.swift | 0061-issue-45761.swift | Swift | 730 | 0.8 | 0 | 0.148148 | vue-tools | 715 | 2024-03-15T14:45:14.702205 | Apache-2.0 | true | 848a0b2d62add3de99668cac3557d637 |
// RUN: %target-swift-frontend %s -typecheck\n\nprotocol P0 {}\n\nstruct Y : P0 {}\n\nprotocol P1 {\n associatedtype A: P0 = Y\n func f() -> A\n}\n\nextension P1 {\n func f() -> A {\n fatalError()\n }\n}\n\nprotocol P2 : P1 {}\n\nstruct Z<T: P1> : P0 {}\n\nextension P2 {\n func f() -> Z<Self> {\n return Z()\... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0062-rdar28765265.swift | 0062-rdar28765265.swift | Swift | 340 | 0.8 | 0 | 0.047619 | react-lib | 99 | 2023-11-27T21:55:05.838464 | Apache-2.0 | true | d9218c991e7a459e2e631607905a3b26 |
// RUN: %target-swift-frontend %s -emit-ir\n//\n// REQUIRES: objc_interop\n\nimport Foundation\n\npublic class C : NSObject {}\n\npublic protocol P {\n associatedtype A : C\n}\n\npublic class X<T : P> : NSObject {\n public func foo(x: T.A) -> T.A {\n while true {}\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0063-rdar29782437.swift | 0063-rdar29782437.swift | Swift | 262 | 0.95 | 0.176471 | 0.230769 | python-kit | 170 | 2023-08-05T12:14:09.079043 | GPL-3.0 | true | e732f2d175783ce4644983378a5951e2 |
// RUN: %target-typecheck-verify-swift\n\nenum Term<S> where S: Sequence, S.Iterator.Element == Term {\n// expected-error@-1 *{{generic enum 'Term' has self-referential generic requirements}}\n case Cons(head: String, tail: S)\n}\n\nfunc produce<S>(s: S) -> Term<S> {\n return .Cons(head: "hi", tail: s)\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0064-rdar27627862.swift | 0064-rdar27627862.swift | Swift | 302 | 0.95 | 0 | 0.25 | vue-tools | 627 | 2023-09-21T18:06:23.107293 | MIT | true | 3196e98463ea18f28c0db39b914cd5f6 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46291\n\nlet occurrences: [String] = []\nlet results: [(String, Int)] = occurrences.flatMap({ (match: String) -> (String, Int) in\n return ("", 0)\n})\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0065-issue-46291.swift | 0065-issue-46291.swift | Swift | 231 | 0.8 | 0 | 0.333333 | node-utils | 296 | 2025-04-05T02:26:39.433737 | BSD-3-Clause | true | 9cf4da5fc416628dd20c42c79f785bb5 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// rdar://problem/31798398\n// https://github.com/apple/swift/issues/46272\n\npublic protocol QHash : Collection, ExpressibleByArrayLiteral {\n associatedtype Key where Key == Element\n\n init()\n}\n\nextension QHash {\n init(withElements newElements: Key...) {\n self... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0066-issue-46272-updated.swift | 0066-issue-46272-updated.swift | Swift | 321 | 0.8 | 0 | 0.25 | vue-tools | 295 | 2024-01-25T05:44:57.381547 | BSD-3-Clause | true | 9cd0428a354d9d968b6d58499859c972 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// rdar://problem/31798398\n// https://github.com/apple/swift/issues/46272\n\npublic protocol QHash : Collection, ExpressibleByArrayLiteral {\n associatedtype Key\n typealias Element = Key\n\n init()\n}\n\nextension QHash {\n init(withElements newElements: Key...) {\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0066-issue-46272.swift | 0066-issue-46272.swift | Swift | 326 | 0.8 | 0 | 0.230769 | vue-tools | 35 | 2024-06-09T00:21:56.530666 | MIT | true | 617771dd9653c5b09dc07bcc996867a2 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend -emit-module %s -DLIBRARY -I %S/Inputs/0068-issue-46438/ -o %t/Lib.swiftmodule\n// RUN: %target-swift-frontend -emit-sil -primary-file %s %S/Inputs/0068-issue-46438/other.swift -I %S/Inputs/0068-issue-46438/ -I %t -module-name main -DVALID\n\n// Try again in ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0068-issue-46438.swift | 0068-issue-46438.swift | Swift | 714 | 0.95 | 0.083333 | 0.714286 | node-utils | 564 | 2024-12-03T02:27:24.138782 | BSD-3-Clause | true | 26784409d48241cd3d51e2d89d171163 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46442\n\nprotocol P3 {\n associatedtype T\n}\n\nclass C : P3 {\n typealias T = Int\n}\n\nfunc superclassConformance1<T>(_: T, t: T.T) where T : P3, T : C {}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0069-issue-46442.swift | 0069-issue-46442.swift | Swift | 234 | 0.95 | 0.076923 | 0.222222 | vue-tools | 392 | 2023-12-03T00:06:44.664487 | Apache-2.0 | true | 6c47f1aac296aa2cf246b28d59fe9c8f |
// This source file is part of the Swift.org open source project\n// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors\n// Licensed under Apache License v2.0 with Runtime Library Exception\n//\n// See https://swift.org/LICENSE.txt for license information\n// See https://swift.org/CONTRIBUTORS.txt for t... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0070-issue-46103.swift | 0070-issue-46103.swift | Swift | 578 | 0.8 | 0.15 | 0.533333 | react-lib | 234 | 2025-04-08T13:28:22.566273 | MIT | true | 0d06f64f12cb002d58393ed50a52df13 |
// RUN: %empty-directory(%t)\n// RUN: %target-swift-frontend -emit-module %s -DLIBRARY -o %t/Lib.swiftmodule\n// RUN: %target-swift-frontend -typecheck %s -I %t -verify\n\n// REQUIRES: objc_interop\n\n// https://github.com/apple/swift/issues/46299\n\n#if LIBRARY\n\nimport Foundation\npublic class Test: NSObject {\n @o... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0071-issue-46299.swift | 0071-issue-46299.swift | Swift | 514 | 0.95 | 0.08 | 0.470588 | awesome-app | 477 | 2023-10-17T01:07:04.809198 | BSD-3-Clause | true | 05fa6b7371f80e0e602bf85bfcd10697 |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/46480\n\npublic protocol TiView {\n \n}\n\npublic class TiPresenter<V: TiView> {\n \n private var view: V? = nil\n \n public func create() {\n \n }\n \n public func attchView(view: V) {\n s... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0072-issue-46480-1.swift | 0072-issue-46480-1.swift | Swift | 1,746 | 0.95 | 0.068182 | 0.084746 | vue-tools | 546 | 2023-08-13T03:09:23.759204 | Apache-2.0 | true | c8e698bc5f355fdc7580fdd087825204 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46480\n\npublic class TiPresenter<V> {\n \n private var view: V? = nil\n \n public func create() {\n \n }\n \n public func attchView(view: V) {\n self.view = view\n }\n \n public func detac... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0072-issue-46480-2.swift | 0072-issue-46480-2.swift | Swift | 1,351 | 0.95 | 0.067568 | 0.08 | python-kit | 401 | 2025-03-23T19:13:24.055625 | GPL-3.0 | true | cdb0d3e2ce0b55ccc20b3c86b7063855 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/45400\n\nprotocol ViewModel {}\n\nprotocol ViewModelCell {}\n\nprotocol CellAwareViewModel : ViewModel {\n associatedtype CellType: ViewModelCell\n}\n\nprotocol ConfigurableViewModelCell : ViewModelCell {\n associatedtype DataT... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0073-issue-45400.swift | 0073-issue-45400.swift | Swift | 789 | 0.95 | 0.071429 | 0.142857 | python-kit | 159 | 2024-05-09T12:43:20.442590 | Apache-2.0 | true | b51a78690f1f8f83d96364070feec2cd |
// RUN: %target-swift-frontend %s -typecheck\n// RUN: %target-swift-frontend %s -emit-ir -o /dev/null\n\nprotocol P {\n associatedtype A\n associatedtype B\n}\n\nprotocol Q : P {\n associatedtype M\n typealias A = M\n\n}\n\n\nextension Q {\n typealias B = M\n}\n\nprotocol R {\n associatedtype S\n\n init()\n}\n\n... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0075-rdar30248571.swift | 0075-rdar30248571.swift | Swift | 844 | 0.8 | 0 | 0.052632 | python-kit | 863 | 2024-10-15T06:15:52.349430 | MIT | true | 333a3a054ab59c873751870f36e39ec5 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46088\n\nprotocol A {\n associatedtype Coordinate: Strideable\n func doSomething(_: Range<Coordinate>) -> Coordinate.Stride\n}\n\nextension A where Coordinate == Int {\n func extensionFunc(_ range: Range<Coordinate>) {\n _ = do... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0076-issue-46088.swift | 0076-issue-46088.swift | Swift | 332 | 0.8 | 0 | 0.181818 | react-lib | 655 | 2024-02-06T09:48:41.735660 | MIT | true | 1e541b8a903ce6ff57bf6479412b69f7 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46469\n\nprotocol DataSourceItem { }\n\nprotocol TableDataSourceItem : DataSourceItem { }\n\n\nclass DataSource<T : DataSourceItem> { }\n\nclass TableDataSource<T : TableDataSourceItem>: DataSource<T> { }\n\n\nclass DataSourceBuilder... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0077-issue-46469.swift | 0077-issue-46469.swift | Swift | 614 | 0.95 | 0.208333 | 0.181818 | awesome-app | 758 | 2024-03-19T16:37:27.179919 | MIT | true | 8190e1ff77fee6b720b31355933a1339 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46642\n\nclass Base {\n init<S: Sequence>(_ s: S) where S.Iterator.Element == UInt8 { }\n}\n\nclass Sub: Base {\n init(_ b: [UInt8]) { super.init(b) }\n} | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0078-issue-46642.swift | 0078-issue-46642.swift | Swift | 232 | 0.95 | 0.2 | 0.25 | react-lib | 515 | 2024-12-31T19:53:36.498405 | MIT | true | 84d90ef7b3e813646c30eac9aa3e2fdf |
// RUN: %target-swift-frontend %s -emit-ir\n\nextension Sequence {\n typealias Element = Iterator.Element\n}\n\nfunc f<C: Sequence>(c: C) where C.Iterator == C {\n c.makeIterator()\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0079-rdar30702721.swift | 0079-rdar30702721.swift | Swift | 177 | 0.8 | 0 | 0.142857 | vue-tools | 918 | 2024-10-22T21:07:45.611244 | GPL-3.0 | true | 719f25d5fa30301d3950dbf12093151e |
// RUN: %target-swift-frontend -typecheck -primary-file %s\n\nprotocol AnyCodeUnits_ {\n typealias Index = Int64\n typealias Element = UInt32\n var startIndex: Index { get }\n var endIndex: Index { get }\n func index(after: Index) -> Index\n func index(before: Index) -> Index\n func index(_ i: Index, offsetBy: I... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0080-rdar30442622.swift | 0080-rdar30442622.swift | Swift | 994 | 0.8 | 0 | 0.043478 | python-kit | 375 | 2023-11-29T02:52:46.627028 | Apache-2.0 | true | 9d4b3858d3175c09af5a24a30e29829b |
// RUN: not %target-swift-frontend %s -typecheck -o /dev/null\n\nclass FakeDictionary<KeyType, ValueType> : ExpressibleByDictionaryLiteral {\n convenience required init(dictionaryLiteral elements: (FakeDictionary.Key, FakeDictionary.Value)...) {\n self.init()\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0081-rdar30751491.swift | 0081-rdar30751491.swift | Swift | 266 | 0.95 | 0.142857 | 0.166667 | react-lib | 691 | 2024-07-26T16:49:00.806206 | MIT | true | c44c0d656a494ec2b0075656ebcbf38b |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\npublic func ==<T: EquatableMetaType>(lhs: T, rhs: T) -> Bool {\n return type(of: lhs) == type(of: lhs)\n}\n\n\npublic protocol EquatableMetaType {\n}\n\n\nclass Block : Equatable, EquatableMetaType {\n}\n\nextension Array where Element : Block {\n func i... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0082-rdar30354669.swift | 0082-rdar30354669.swift | Swift | 627 | 0.95 | 0.133333 | 0.043478 | awesome-app | 916 | 2024-02-09T08:41:56.808117 | Apache-2.0 | true | 39da2db74051724c758f52678647715f |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\nstruct First<T> {}\nstruct Second<T> {}\n\nstruct Node<T> {\n func create<U>() where T == First<U> { }\n func create<U>() where T == Second<U> { }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0083-rdar31163470-1.swift | 0083-rdar31163470-1.swift | Swift | 204 | 0.8 | 0 | 0.142857 | python-kit | 974 | 2024-11-01T21:30:49.919077 | Apache-2.0 | true | 65fef56546703c80d683a59c2fc86e29 |
// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s\n// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\nprotocol C {\n associatedtype I\n}\n\nprotocol PST {\n associatedtype LT : C\n}\n\nprotocol SL {\n associatedtype S : PST\n}\n\nstruct PEN<_S : PST> : SL {\n typea... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0083-rdar31163470-2.swift | 0083-rdar31163470-2.swift | Swift | 511 | 0.8 | 0 | 0.190476 | python-kit | 337 | 2024-09-26T13:50:14.366568 | GPL-3.0 | true | d4b92ab678b379469f88a8f436e08861 |
// RUN: %target-swift-frontend -swift-version 4 %s -typecheck -o /dev/null\n\n// This should actually type check successfully.\n\nprotocol P {\n associatedtype T\n}\n\nprotocol Q1 : P {\n typealias T = Int\n\n func f(_: T)\n}\n\nprotocol Q2 : P {\n associatedtype T where T == Int\n\n func f(_: T)\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0084-rdar31093854.swift | 0084-rdar31093854.swift | Swift | 288 | 0.8 | 0 | 0.153846 | vue-tools | 521 | 2023-08-29T23:23:30.136768 | BSD-3-Clause | true | 979b3a6a91c74b17113d7daf9b58e28e |
// RUN: %target-swift-frontend -emit-silgen -primary-file %s -o /dev/null\n\nclass Base<T> {\n convenience init(count: Int) {\n self.init(count: count, designated: ())\n }\n\n init(count: Int, designated: ()) {\n }\n}\n\nclass Derived<T> : Base<T> {\n convenience init() {\n self.init(count: 0)\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0085-rdar31000248.swift | 0085-rdar31000248.swift | Swift | 299 | 0.95 | 0.125 | 0.076923 | python-kit | 179 | 2024-08-01T17:43:18.398192 | MIT | true | 769bb7b7c4e2aeb477b351600bc3de7f |
// RUN: not %target-swift-frontend -typecheck -primary-file %s\n\n// https://github.com/apple/swift/issues/46884\n\nprotocol P {\n init()\n}\n\nextension P {\n public init(x: Int, y: Int? = nil) {\n self.init()\n }\n}\n\nfunc foo(t: P.Type, a: Int) {\n let _ = t(x: a)\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0086-issue-46884.swift | 0086-issue-46884.swift | Swift | 263 | 0.8 | 0 | 0.153846 | vue-tools | 594 | 2024-10-26T21:24:25.467507 | GPL-3.0 | true | a12782080b3dc68c0340c870a96438a0 |
// RUN: %target-swift-frontend -emit-ir %s\n\n// https://github.com/apple/swift/issues/46601\n\npublic enum Event<Element, Error: Swift.Error> {\n case next(Element)\n case failed(Error)\n case completed\n} \n\npublic typealias Observer<Element, Error: Swift.Error> = (Event<Element, Error>) -> Void\n\npublic protoco... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0087-issue-46601.swift | 0087-issue-46601.swift | Swift | 1,808 | 0.95 | 0.014286 | 0.234043 | python-kit | 689 | 2025-02-10T03:44:15.491148 | BSD-3-Clause | true | 6c49a2c481f3b50f54da09ab80aac553 |
// RUN: %target-swift-frontend -emit-ir %s\n\n// https://github.com/apple/swift/issues/46898\n\npublic protocol ParsableResult {\n associatedtype Parser\n}\n\nfinal class ResultElement<T> {\n}\n\n\nenum InteractiveAPIError: Error {\n case malformedResult\n}\n\nclass XMLSAXElementParser<ChildElement> {\n public... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0088-issue-46898.swift | 0088-issue-46898.swift | Swift | 529 | 0.95 | 0.1 | 0.105263 | python-kit | 411 | 2024-08-15T23:07:53.868428 | BSD-3-Clause | true | 7d2618275317e86cc45431ed177fc483 |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\n// REQUIRES: objc_interop\n\n// https://github.com/apple/swift/issues/47035\n\nimport Foundation\n\nextension MutableCollection {\n typealias SubSequence = Slice<Data>\n}\n\nprint(type(of: Data.self.SubSequence.self))\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0089-issue-47035.swift | 0089-issue-47035.swift | Swift | 267 | 0.95 | 0 | 0.375 | python-kit | 130 | 2025-02-23T01:54:43.877063 | BSD-3-Clause | true | a6c973c2e233540f31d47babf1aa4f7f |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\n// From https://twitter.com/Dimillian/status/854436731894018048\n\nclass User: Equatable {\n var id: String = ""\n var username: String = ""\n var name: String = ""\n var avatar: String?\n var friends: [String]?\n var followers: [String]?\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0090-emit-implied-witness-table-ref.swift | 0090-emit-implied-witness-table-ref.swift | Swift | 1,317 | 0.95 | 0.04 | 0.045455 | react-lib | 545 | 2024-09-09T14:23:28.860566 | BSD-3-Clause | true | c49e3dc4763da7a6af2f4dadc3d32f19 |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\n// https://github.com/apple/swift/issues/47194\n\nextension Dictionary {\n init<S: Sequence>(grouping elements: S, by keyForValue: (S.Iterator.Element) -> Key)\n where Array<S.Iterator.Element> == Value\n {\n self = [:]\n for value in elements {\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0090-issue-47194.swift | 0090-issue-47194.swift | Swift | 436 | 0.8 | 0.0625 | 0.142857 | awesome-app | 550 | 2025-06-04T12:58:00.888682 | Apache-2.0 | true | 0f4d6c287875922d920da2b388f5415d |
// RUN: %target-swift-frontend -emit-ir -primary-file %s\n\nclass Base<T: AnyObject> {}\n\nclass Derived: Base<Derived> {}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0091-rdar30168645.swift | 0091-rdar30168645.swift | Swift | 119 | 0.95 | 0.4 | 0.333333 | python-kit | 886 | 2025-05-04T12:53:41.749003 | MIT | true | 605d30b7942cb52ed45c1c6edaef1284 |
// RUN: not %target-swift-frontend %s -typecheck\n// REQUIRES: objc_interop\n\nimport Foundation\nlet nsd: NSDictionary = [NSObject : AnyObject]()\n\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0092-se-0154.swift | 0092-se-0154.swift | Swift | 144 | 0.95 | 0 | 0.5 | awesome-app | 56 | 2025-02-25T10:05:38.634887 | MIT | true | 556529db5e79bcd05ece75491d961319 |
// RUN: %target-swift-frontend -primary-file %s -emit-ir\n\n// https://github.com/apple/swift/issues/47048\n\nprotocol P: AnyObject {}\nprotocol Foo {\n // The compiler crash goes away if you remove the P constraint on this associated type\n associatedtype ObjectType: P\n}\n\nprotocol UpcastHelper {\n associat... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0093-issue-47048.swift | 0093-issue-47048.swift | Swift | 1,015 | 0.95 | 0.071429 | 0.172414 | node-utils | 451 | 2025-06-23T09:07:09.156088 | Apache-2.0 | true | bb2891cb29250a328e1b5ccada0976e2 |
// RUN: not %target-swift-frontend %s -emit-ir\n\npublic struct Trie<Key: Hashable, Value> {\n\n internal var root: TrieNode<Key, Value>\n\n public init() {\n self.root = TrieNode<Key, Value>()\n }\n\n public mutating func removeValue<C: Collection>(forCollection collection: C) -> Value? where C.Iter... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0094-rdar30689883.swift | 0094-rdar30689883.swift | Swift | 1,711 | 0.8 | 0 | 0.027778 | node-utils | 665 | 2024-11-26T14:31:48.691410 | GPL-3.0 | true | 5d00ef02655ae557af99135c6a4f854c |
// RUN: not %target-swift-frontend %s -typecheck\n\nstruct X<T> {}\nstruct Y<T> {}\n\nprotocol P {\n associatedtype T = X<U>\n associatedtype U\n\n func foo() -> T\n}\n\nprotocol Q: P {\n func bar() -> T\n func bas() -> U\n}\n\nextension P {\n func foo() -> X<U> { fatalError() }\n}\n\nextension Q {\n func foo() ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0095-rdar30154791.swift | 0095-rdar30154791.swift | Swift | 457 | 0.8 | 0 | 0.04 | awesome-app | 982 | 2024-09-12T03:29:15.385058 | MIT | true | 5ff20c44d06e89ce648aca9150e41586 |
// RUN: not %target-swift-frontend -emit-ir -primary-file %s\n\n// https://github.com/apple/swift/issues/46855\n//\n// FIXME: Should this type check?\n\nstruct ArrayWrapper<Element>: Collection\n where Element: Comparable {\n private var store = [Element]()\n\n typealias SubSequence = ArrayWrapper<Element>\n\n... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0096-issue-46855.swift | 0096-issue-46855.swift | Swift | 876 | 0.8 | 0 | 0.133333 | python-kit | 631 | 2024-10-14T22:39:12.700314 | Apache-2.0 | true | e1edfbb84a52b162a23a4719741a758e |
// RUN: not %target-swift-frontend -typecheck -primary-file %s -debug-generic-signatures 2>&1 | %FileCheck %s\n\n// CHECK-LABEL: .hexEncodeBytes@\n// CHECK-NEXT: <T where T : Collection, T.[Sequence]Element == UInt8>\nfunc hexEncodeBytes<T: Collection>(_ bytes: T) where T.Generator.Element == UInt8 { }\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0097-rdar32077627.swift | 0097-rdar32077627.swift | Swift | 300 | 0.8 | 0 | 0.75 | node-utils | 210 | 2024-09-19T12:52:04.055156 | Apache-2.0 | true | e2c336327d0830474275c28437a33866 |
// RUN: %target-swift-frontend -emit-ir -primary-file %s\n\npublic func ==<T: EquatableMetaType>(lhs: T, rhs: T) -> Bool {\n return type(of: lhs) == type(of: lhs)\n}\n\n\npublic protocol EquatableMetaType {\n}\n\n\nclass Block : Equatable, EquatableMetaType {\n}\n\nextension Array where Element : Block {\n func index... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0098-rdar30354669.swift | 0098-rdar30354669.swift | Swift | 553 | 0.95 | 0.133333 | 0.043478 | react-lib | 346 | 2025-05-14T10:34:57.305013 | BSD-3-Clause | true | 23174f2184237b652e95691eedd59dbc |
// RUN: not %target-swift-frontend -typecheck -primary-file %s\n\n// https://github.com/apple/swift/issues/47550\n\nclass IndexPath {\n let item: Int\n let row: Int\n\n init(item: Int, section: Int) {\n self.item = item\n self.row = section\n }\n}\n\n// Not valid code of course ("[Element]" would need to be "... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0099-issue-47550.swift | 0099-issue-47550.swift | Swift | 640 | 0.95 | 0.034483 | 0.2 | react-lib | 308 | 2023-11-26T08:52:41.978313 | MIT | true | ca115958c3ab4f1eaa3f20218343074f |
// RUN: not %target-swift-frontend -emit-ir -primary-file %s\n\n// https://github.com/apple/swift/issues/46878\n\ninternal protocol _UTFEncoding {\n associatedtype EncodedScalar where EncodedScalar == Int\n}\n\npublic protocol _UnicodeEncoding {\n associatedtype EncodedScalar : BidirectionalCollection\n}\n\npubli... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0100-issue-46878.swift | 0100-issue-46878.swift | Swift | 566 | 0.8 | 0 | 0.133333 | python-kit | 530 | 2023-08-21T13:54:57.861626 | GPL-3.0 | true | 3bfd7c76414b528cc3ccc3dd89fd310e |
// RUN: not %target-swift-frontend -emit-ir -primary-file %s\n\n// https://github.com/apple/swift/issues/47591\n\nstruct Version {\n}\n\nextension CountableRange where Bound == Version {\n func contains(_ element: Version) -> Bool {\n fatalError()\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0101-issue-47591.swift | 0101-issue-47591.swift | Swift | 257 | 0.8 | 0 | 0.222222 | python-kit | 379 | 2024-08-13T17:59:32.509409 | BSD-3-Clause | true | 271b523feda66d12aeb6d39ce30a0554 |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/47152\n\nstruct V<T> : BidirectionalCollection {}\nstruct S {\n func bar<T>(_ to: T.Type) -> V<T> {\n return V<T>()\n }\n}\n\nextension S {\n func foo<R>(_ body: (UnsafeBufferPointer<UTF16.CodeUnit>) -> R) -> R {\n ret... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0102-issue-47152.swift | 0102-issue-47152.swift | Swift | 375 | 0.8 | 0 | 0.153846 | python-kit | 286 | 2025-04-24T10:52:53.160112 | GPL-3.0 | true | 9ce55f3b58c10d7c485f581aca15cfd5 |
// RUN: not %target-swift-frontend -typecheck -primary-file %s\n\n// https://github.com/apple/swift/issues/47320\n\npublic struct _UIntBuffer<Storage, Element> {\n var _storage: Storage\n var _bitCount: UInt8\n}\n\nprotocol _UTFDecoder {\n associatedtype BufferStorage\n associatedtype CodeUnit\n\n var buffer: _UIn... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0103-issue-47320.swift | 0103-issue-47320.swift | Swift | 514 | 0.8 | 0 | 0.125 | python-kit | 450 | 2024-01-14T23:48:57.393285 | Apache-2.0 | true | da23b4517db636cc518602eb6b1668e2 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/46967\n\nclass IndexPath {\n init(indexes: [Int]) {}\n}\n\nextension CountableRange where Bound == Int {\n func indexPaths(inSection section: Bound) -> [IndexPath] {\n return reduce([]) { $0 + [IndexPath(indexes: [section, $1])... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0104-issue-46967.swift | 0104-issue-46967.swift | Swift | 321 | 0.95 | 0.076923 | 0.2 | vue-tools | 53 | 2024-01-22T23:01:25.031998 | BSD-3-Clause | true | 7be316d29070ee3682c21a27ad74e420 |
// RUN: %target-swift-frontend %s -emit-ir\n\n// https://github.com/apple/swift/issues/43869\n\nclass Expression<A, R> {\n typealias Arg = A\n typealias Ret = R\n subscript(x: Arg) -> Ret! { return nil }\n}\nclass Op<A, R> : Expression<A, R> {\n typealias OpType = (Arg) -> Ret\n let op: OpType\n init(op: @escaping OpTy... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0105-issue-43869.swift | 0105-issue-43869.swift | Swift | 594 | 0.95 | 0.107143 | 0.08 | node-utils | 672 | 2023-09-09T07:08:27.976579 | BSD-3-Clause | true | 3a0fd3317e0249d9c62c432c63dbe03b |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/47626\n\nprotocol P {}\n\nfunc bar(p: P?) {\n foo(p is String)\n}\n \nfunc foo<T>(_: T, _: T) {}\nfunc foo<T>(_: T?, _: T?) {}\n\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0105-issue-47626.swift | 0105-issue-47626.swift | Swift | 214 | 0.8 | 0 | 0.25 | react-lib | 731 | 2024-04-18T00:46:47.283686 | Apache-2.0 | true | 389e9da8e20362840616fb5a702963ec |
// RUN: %target-swift-frontend %s -emit-ir\n// REQUIRES: objc_interop\n\nfunc f(_: AnyObject?) { }\n\nclass C {\n private var a: Int\n private var b: Int\n\n func test() {\n f((self.a, self.b) as AnyObject)\n }\n\n init() {\n a = 0\n b = 0\n }\n}\n\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0106-rdar32700180.swift | 0106-rdar32700180.swift | Swift | 246 | 0.95 | 0.052632 | 0.142857 | awesome-app | 794 | 2025-03-23T05:22:32.339687 | MIT | true | 676cce34fef5a19c0e4f99cd045bce54 |
// RUN: %target-swift-frontend %s -emit-ir\nstruct X<T: Q> {\n func f(_: T.Z) { }\n}\n\nprotocol P {\n associatedtype A\n associatedtype B\n}\n\nprotocol Q {\n associatedtype C: P\n typealias Z = (C.A, C.B)\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0107-rdar32700180.swift | 0107-rdar32700180.swift | Swift | 202 | 0.8 | 0 | 0.083333 | awesome-app | 513 | 2024-02-12T18:12:38.920481 | MIT | true | 6a430e7a4817ed729bf5c6d07cdc1340 |
// RUN: %target-swift-frontend -emit-ir -primary-file %s\n\n// https://github.com/apple/swift/issues/46671\n\nclass UITableViewCell {}\nclass UITableView {}\n\nextension UITableViewCell: ReusableViewProtocol {\n public typealias ParentView = UITableView\n}\n\nprotocol ReusableViewProtocol {\n associatedtype Paren... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0108-issue-46671.swift | 0108-issue-46671.swift | Swift | 618 | 0.95 | 0.08 | 0.105263 | vue-tools | 268 | 2024-08-10T06:39:17.609676 | Apache-2.0 | true | 1238747cf63291bc54112415d2b5a07c |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/47314\n\n//===----------------------------------------------------------------------===//\nextension UnicodeScalar {\n // Hack providing an efficient API that is available to the standard library\n @usableFromInline\n @inlin... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0109-issue-47314.swift | 0109-issue-47314.swift | Swift | 91,384 | 0.75 | 0.02101 | 0.215275 | python-kit | 599 | 2024-11-14T20:54:27.546973 | GPL-3.0 | true | b5143c779d27c82a2ef2677b46e9c282 |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/47363\n\npublic protocol _UTFEncoding {\n associatedtype EncodedScalar where EncodedScalar == Int\n}\n\npublic protocol UnicodeEncoding {\n associatedtype EncodedScalar: BidirectionalCollection\n}\n\npublic protocol _UTFP... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0110-issue-47363.swift | 0110-issue-47363.swift | Swift | 377 | 0.8 | 0 | 0.181818 | awesome-app | 959 | 2024-02-17T01:31:57.303409 | BSD-3-Clause | true | 56001eb8b510ef56c9d81e9762d7f768 |
// RUN: %target-swift-frontend -swift-version 4 %s -typecheck\n\nfunc flatterMap(_ records: [(Int)]) -> [Int] {\n records.flatMap { _ in return 1 } // expected-note {{}}\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0111-rdar33067102.swift | 0111-rdar33067102.swift | Swift | 170 | 0.8 | 0 | 0.25 | python-kit | 105 | 2024-12-18T04:01:43.187644 | MIT | true | 10d4725a16b2b1b5ef4825b78828a57b |
// RUN: not %target-swift-frontend %s -typecheck\n\nenum State<StateType> {\n func put<StateType>() -> StateType {}\n func put<T>(keyPath: WritableKeyPath<StateType, T>, projection: T) {\n put(keyPath: \.age, projection: {})\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0112-rdar33135487.swift | 0112-rdar33135487.swift | Swift | 231 | 0.8 | 0 | 0.142857 | vue-tools | 29 | 2024-02-01T04:07:25.238333 | MIT | true | 477c5f1fd028a9a5ef03b138a9b91197 |
// RUN: %target-swift-frontend -swift-version 4 %s -emit-ir\n\nstruct X<Elements: Sequence> { }\nextension X where Elements == [Int] { }\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0112-rdar33139928.swift | 0112-rdar33139928.swift | Swift | 134 | 0.8 | 0 | 0.333333 | awesome-app | 49 | 2025-03-09T18:08:46.265873 | GPL-3.0 | true | 2c30ce70e78ce280f55945602247e84f |
// RUN: not %target-swift-frontend %s -typecheck\n\npublic class A {\n var property: UndeclaredType\n var keyPath: Any {\n return #keyPath(property.foo)\n }\n}\n\npublic class B {\n var property: UndeclaredType\n var keyPath: Any {\n return [#keyPath(property.foo)]\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0113-rdar33044867.swift | 0113-rdar33044867.swift | Swift | 271 | 0.95 | 0.133333 | 0.076923 | awesome-app | 536 | 2024-06-04T11:43:52.936566 | MIT | true | 52aaed3287f6a379dcfb1824a9fd2992 |
// RUN: %target-swift-frontend %s -typecheck\n\nstruct Bar : BarProtocol {\n typealias Element = Int\n}\n\nstruct Foo: FooProtocol {\n typealias Things = Bar\n func thing() -> Thing {}\n}\n\nprotocol BarProtocol {\n associatedtype Element\n}\n\nprotocol FooProtocol {\n associatedtype Things: BarProtocol\... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0114-rdar33189068.swift | 0114-rdar33189068.swift | Swift | 343 | 0.8 | 0 | 0.066667 | react-lib | 450 | 2024-03-06T22:23:25.900961 | Apache-2.0 | true | 55dd1f0454a0613378240e13df1a0abd |
// RUN: %target-swift-frontend %s -typecheck -verify\n// RUN: %target-swift-frontend %s -emit-ir -o /dev/null\n\n// https://github.com/apple/swift/issues/48173\n\nprotocol P1 {\n associatedtype X: P3 where X.Q == Self, X.R == UInt8\n associatedtype Y: P3 where Y.Q == Self, Y.R == UInt16\n // NOTE: Removing eit... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0115-issue-48173.swift | 0115-issue-48173.swift | Swift | 644 | 0.8 | 0 | 0.190476 | awesome-app | 60 | 2024-01-20T03:58:19.849133 | MIT | true | a3a2a59d0f90c805d264b3922e528922 |
// RUN: not %target-swift-frontend %s -typecheck\n\n// Bug with associated type inference. Really, this should type check\n// with 'SomeAssociatedType' inferred as 'Any', but for now, it's good\n// enough to not crash.\n\nprotocol SomeProtocol {\n associatedtype SomeAssociatedType = Any\n static func staticFunc(_ arg... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0116-rdar33365139.swift | 0116-rdar33365139.swift | Swift | 539 | 0.95 | 0.125 | 0.307692 | react-lib | 324 | 2025-03-11T13:02:00.669230 | Apache-2.0 | true | 98c6ab94984fe61bd7a59091a1e9f8cb |
// RUN: %target-typecheck-verify-swift\n\nclass C {\n private init() {}\n init(n: Int) {} // expected-note {{'init(n:)' declared here}}\n}\n\n// TODO(diagnostics): Once "inaccessible members" are ported to the new framework it would be possible\n// to bring back `'C' initializer is inaccessible due to 'private' prote... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0117-rdar33433087.swift | 0117-rdar33433087.swift | Swift | 437 | 0.95 | 0.181818 | 0.444444 | node-utils | 694 | 2024-09-14T04:06:26.681901 | BSD-3-Clause | true | ced5653e092c44213b76c1b45e1f59ee |
// RUN: %target-typecheck-verify-swift\n\nenum E { case A }\n\nclass C<T> {\n struct Nested {\n var value: T\n }\n}\n\nclass D: C<E> {\n func test() {\n _ = Nested(value: .A)\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0118-rdar31529413.swift | 0118-rdar31529413.swift | Swift | 178 | 0.95 | 0.133333 | 0.083333 | node-utils | 534 | 2024-06-08T01:30:41.193283 | Apache-2.0 | true | bd2062a5869d566411149b29db1f06f9 |
// RUN: %target-typecheck-verify-swift\n\nprecedencegroup BindingPrecedence {\n higherThan: DefaultPrecedence\n}\n\ninfix operator ~>\ninfix operator ≈> : BindingPrecedence\n\nstruct M<L : P, R> {\n let f: L\n let b: (inout L.B) -> R\n\n init(f: L, b: @escaping (inout L.B) -> R) {\n self.f = f\n self.b = b\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0119-rdar33613329.swift | 0119-rdar33613329.swift | Swift | 1,044 | 0.95 | 0.022222 | 0.060606 | awesome-app | 883 | 2023-08-18T01:58:45.869109 | BSD-3-Clause | true | 2ccec7d12bef9ebdf7346fce802504ab |
// RUN: not %target-swift-frontend %s -typecheck\n\nprotocol P {\n associatedtype A1 : Q where A1.A2 == Self\n\n var a1: A1? { get set }\n\n func start()\n}\n\nprotocol Q {\n associatedtype A2 : P where A2.A1 == Self\n\n func didStart(transport: A2)\n}\n\nclass C<D> : P\n where D : Q, D.A2 == Self\n{\n typealias... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0120-rdar34184392.swift | 0120-rdar34184392.swift | Swift | 420 | 0.95 | 0.064516 | 0.045455 | react-lib | 471 | 2023-08-30T20:02:51.471823 | BSD-3-Clause | true | 008d6b430499e2693aff594eec2b27f1 |
// RUN: not %target-swift-frontend %s -typecheck\n\nclass C { }\n\nprotocol PI\n{\n init()\n}\n\nprotocol MDS\n{\n associatedtype Index : PI\n func f(_ : MVC<Index, Self>, atIndex index : Index) -> C?\n}\n\nclass MVC<Index : PI, DataSource : MDS>: C where DataSource.Index == Index\n{\n \n}\n\nstruct LPI : P... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0121-rdar26498438.swift | 0121-rdar26498438.swift | Swift | 446 | 0.95 | 0.075 | 0.033333 | vue-tools | 387 | 2024-12-07T12:13:59.347783 | MIT | true | 91ffd8d38b5f65cfd6adfa34bc4054e6 |
// RUN: %target-swift-frontend %s -typecheck -verify\n// REQUIRES: OS=macosx\n\nimport Foundation\nimport CoreData\n\n// Does not segfault\n\n@available(macOS 10.12, *)\nclass Foo<T>: NSObject, NSFetchedResultsControllerDelegate {\n override init() {\n super.init()\n }\n \n @nonobjc func controllerWi... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0122-rdar27383752.swift | 0122-rdar27383752.swift | Swift | 864 | 0.95 | 0.090909 | 0.192308 | awesome-app | 74 | 2024-05-22T03:35:39.202392 | Apache-2.0 | true | 3af6f5c41dbb4a5b829a065bbd3f732f |
// RUN: %target-typecheck-verify-swift\n\nprotocol P {\n associatedtype A\n}\nstruct Straint<C: P> where C.A : P {\n typealias X = Any \n}\nprotocol Q : Straint<Self>.X {} // expected-error {{type 'Self' does not conform to protocol 'P'}}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0122-rdar30965000.swift | 0122-rdar30965000.swift | Swift | 232 | 0.8 | 0 | 0.125 | react-lib | 878 | 2024-09-01T19:59:18.215893 | MIT | true | ec51826b5b4f9ac0a14b6d36b3185fcb |
// RUN: not %target-swift-frontend -parse-stdlib -DBUILDING_OUTSIDE_STDLIB %s -emit-ir\n// REQUIRES: objc_interop\n\n//===----------------------------------------------------------------------===//\n//\n// This source file is part of the Swift.org open source project\n//\n// Copyright (c) 2014 - 2017 Apple Inc. and the... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0123-rdar31164540.swift | 0123-rdar31164540.swift | Swift | 29,625 | 0.95 | 0.107066 | 0.109771 | vue-tools | 427 | 2025-04-15T09:57:54.961217 | BSD-3-Clause | true | 1b87d987635839311d9d7e30a20f0044 |
// RUN: %target-swift-frontend -emit-ir %s\n\n// https://github.com/apple/swift/issues/48395\n\npublic struct DefaultAssociatedType {\n}\n\nprotocol Protocol {\n associatedtype AssociatedType = DefaultAssociatedType\n init(object: AssociatedType)\n}\n\npublic final class Conformance: Protocol {\n private let o... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0124-issue-48395.swift | 0124-issue-48395.swift | Swift | 408 | 0.95 | 0.055556 | 0.142857 | python-kit | 805 | 2023-11-09T19:32:21.640874 | BSD-3-Clause | true | ef52134704d9ed91ca214dda062e68e9 |
// RUN: not %target-swift-frontend -typecheck %s \n\npublic class MyCollection : MutableCollection {\n public var startIndex: MyCollection.Index\n public var endIndex: MyCollection.Index\n}\n\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0125-rdar33575781.swift | 0125-rdar33575781.swift | Swift | 188 | 0.95 | 0.142857 | 0.2 | react-lib | 853 | 2023-10-03T01:17:13.984492 | BSD-3-Clause | true | 687c54404f4945bb08f7cd0f5cde0fcc |
// RUN: %target-swift-frontend -emit-ir %s\n\n// https://github.com/apple/swift/issues/48464\n\npublic protocol VectorIndex {\n associatedtype Vector8 : Vector where Vector8.Index == Self, Vector8.Element == UInt8\n}\npublic enum VectorIndex1 : VectorIndex {\n case i0\n public typealias Vector8 = Vector1<UInt8... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0126-issue-48464.swift | 0126-issue-48464.swift | Swift | 884 | 0.8 | 0 | 0.071429 | vue-tools | 739 | 2023-08-17T02:46:20.887630 | MIT | true | 4f97993a58218e9b9170220ee7d13bbb |
// RUN: %target-typecheck-verify-swift\n\n// https://github.com/apple/swift/issues/48118\n\npublic struct Foo<A, B, C> {}\n\npublic protocol P {\n associatedtype PA\n associatedtype PB = Never\n associatedtype PC = Never\n\n typealias Context = Foo<PA, PB, PC>\n\n func f1(_ x: Context, _ y: PA)\n func... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0127-issue-48118.swift | 0127-issue-48118.swift | Swift | 868 | 0.8 | 0 | 0.064516 | python-kit | 117 | 2024-11-15T15:21:16.335669 | MIT | true | 66753574b37ec2b66dd844322a7bf2da |
// RUN: %target-typecheck-verify-swift\n\nprotocol Command {}\n\nstruct A : Command {}\nstruct B : Command {}\n\n// This used to crash in Xcode 9 GM, and fails with a diagnostic in more\n// recent swift-4.0-branch builds, because we incorrectly infer the type\n// of the array literal as [Any].\n\nlet a = Array<Command.... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0128-rdar35088384.swift | 0128-rdar35088384.swift | Swift | 333 | 0.8 | 0 | 0.5 | python-kit | 53 | 2025-02-26T13:15:22.040915 | GPL-3.0 | true | 41fc9a8be735474acae44605b3c38551 |
// RUN: not %target-swift-frontend %s -typecheck\n\nenum SortOrder {\n case ascending\n case equal\n case descending\n}\n\nstruct SortedArray<Element> {\n var contents = [Element]()\n let compare: (Element, Element) -> SortOrder\n\n init(_ comparator: @escaping (Element, Element) -> SortOrder) {\n ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0129-rdar35019075.swift | 0129-rdar35019075.swift | Swift | 881 | 0.8 | 0.069767 | 0.030303 | react-lib | 938 | 2024-03-03T09:41:35.542799 | MIT | true | 967228ff314001e697f724726323aebf |
// RUN: not %target-swift-frontend -typecheck %s\n\n// https://github.com/apple/swift/issues/47590\n\nprotocol A {\n associatedtype B\n}\n\nextension A {\n func foo() {\n (B.self as! Sequence.Type).Element\n }\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0130-issue-47590.swift | 0130-issue-47590.swift | Swift | 217 | 0.8 | 0 | 0.2 | awesome-app | 998 | 2023-12-29T11:51:53.502781 | BSD-3-Clause | true | 6fb0195c5ef271866f6d0e4e3d41e02d |
// RUN: %target-swift-frontend %s -emit-ir\n\npublic protocol ObservableType {\n associatedtype E\n}\n\npublic protocol SubjectType : ObservableType {\n associatedtype SubjectObserverType : ObserverType\n}\n\nextension ObservableType {\n public func multicast<S: SubjectType>(_ subject: S) -> Observable<S.E> {\n w... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0130-rdar35632543.swift | 0130-rdar35632543.swift | Swift | 751 | 0.95 | 0.083333 | 0.037037 | node-utils | 987 | 2024-12-19T12:38:47.666184 | MIT | true | c02dd2bf08d97fa778714f9e2b819015 |
// RUN: not %target-swift-frontend %s -typecheck\n\n// https://github.com/apple/swift/issues/49016\n\nprotocol DC {\n init()\n}\n\nprotocol P {\n associatedtype A: DC\n\n func f() -> A\n}\n\nprotocol Q: P {\n associatedtype A\n}\n\nextension Q {\n func f() -> A { return A() }\n}\n\nstruct X<T> { }\n\nextension X: ... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0131-issue-49016.swift | 0131-issue-49016.swift | Swift | 364 | 0.8 | 0 | 0.095238 | python-kit | 747 | 2024-03-20T12:59:59.573836 | MIT | true | e00ba7a63c53e41e10f9fbc1d231c9f6 |
// RUN: not %target-swift-frontend %s -typecheck\n\nstruct A<T> {\n private var b: [T]\n}\n\nfunc foo(v: [Int]) {\n let _ = A(b: v.sorted { $0 < $1 }.map{ $0 })\n}\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0132-rdar35699666.swift | 0132-rdar35699666.swift | Swift | 158 | 0.8 | 0 | 0.142857 | node-utils | 551 | 2023-11-01T22:34:27.130439 | Apache-2.0 | true | 0902eea1a226bd2597df25601fbc0f41 |
// RUN: %target-swift-frontend %s -emit-ir -o -\n\nfunc f() {\n enum NotAnError: Swift.Error {\n case nope(length: Int)\n }\n}\n\n | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0133-rdar35832679.swift | 0133-rdar35832679.swift | Swift | 127 | 0.8 | 0 | 0.166667 | node-utils | 109 | 2024-01-24T03:38:30.355434 | BSD-3-Clause | true | 960ea502f0e84d9b405b62b9ef40caac |
// RUN: %target-swift-frontend %s -O -Xllvm -sil-print-types -emit-sil | %FileCheck %s\n\n// CHECK-LABEL: sil shared [transparent] [thunk] @$sSf4main7NumProtA2aBP5valueSdyFTW : $@convention(witness_method: NumProt) (@in_guaranteed Float) -> Double\n// CHECK-NOT: %1 = load %0 : $*Float\n// CHECK-NOT: function_ref @$sSf4... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0134-rdar35947198.swift | 0134-rdar35947198.swift | Swift | 1,361 | 0.95 | 0.019231 | 0.219512 | vue-tools | 908 | 2024-07-07T21:28:53.889219 | BSD-3-Clause | true | 313977ed1e7ef50043c90eb4c7daa629 |
// RUN: not %target-swift-frontend %s -typecheck\n\nprotocol ProtocolWithCount: Collection {\n var count : UInt64 { get }\n}\n\nclass ClassWithoutCount : ProtocolWithCount {\n// var count: UInt64 = 0\n var startIndex: UInt64 { get { return 0 }}\n var endIndex: UInt64 { get { return 0 }}\n subscript(i:UIn... | dataset_sample\swift\apple_swift\validation-test\compiler_crashers_2_fixed\0135-rdar26140749.swift | 0135-rdar26140749.swift | Swift | 345 | 0.95 | 0.076923 | 0.2 | vue-tools | 17 | 2024-02-04T19:06:56.082959 | BSD-3-Clause | true | d99c29a93b9d2e6a8222d5a0d33e4987 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.