"Fossies" - the Fresh Open Source Software Archive

Member "swift-swift-5.1.2-RELEASE/validation-test/compiler_crashers_fixed/00027-void-map-over-sequence.swift" (7 Nov 2019, 641 Bytes) of package /linux/misc/swift-swift-5.1.2-RELEASE.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Swift source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "00027-void-map-over-sequence.swift": 4.2.3_vs_5.0.

    1 // This source file is part of the Swift.org open source project
    2 // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
    3 // Licensed under Apache License v2.0 with Runtime Library Exception
    4 //
    5 // See https://swift.org/LICENSE.txt for license information
    6 // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
    7 
    8 // RUN: %target-swift-frontend %s -emit-ir
    9 
   10 // Test case submitted to project by https://github.com/tmu (Teemu Kurppa)
   11 // rdar://18118173
   12 
   13 class a<T : Hashable> {
   14   var b = [T : Bool]()
   15   init<S : Sequence>(_ c: S) where S.Iterator.Element == T {
   16     c.map { self.b[$0] = true }
   17   }
   18 }
   19 a([1])