Avatar
swiftbot BOT 6/7/2018 3:00 PM
Author icon
omochimetaru
extension Sequence { public func flatten<T>() -> [T] where Iterator.Element : Sequence, Iterator.Element.Iterator.Element == T { return flatMap { $0 } } } let a: [[Int]] = [[2, 3], [5]] let b: [Int] = a.flatten() print(b)
Version:
swift-3.0.1-RELEASE
Output:
Error:
0 swift 0x0000000003350548 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 swift 0x000000000334ed46 llvm::sys::RunSignalHandlers() + 54 2 swift 0x0000000003351076 3 libpthread.so.0 0x00007fd48f4d8390 4 swift 0x0000000001154f30 swift::TypeBase::getDesugaredType() + 32 5 swift 0x0000000001018bf5 swift::ArchetypeBuilder::resolveArchetype(swift::Type) + 21 6 swift 0x000000000101882b swift::ArchetypeBuilder::PotentialArchetype::getType(swift::ArchetypeBuilder&) + 1915 7 swift 0x000000000101d575 swift::ArchetypeBuilder::getArchetype(swift::GenericTypeParamDecl*) + 53 8 swift 0x0000000000f0c29f swift::TypeChecker::finalizeGenericParamList(swift::ArchetypeBuilder&, swift::GenericParamList*, swift::DeclContext*) + 191 9 swift 0x0000000000ee0f39 10 swift 0x0000000000ed15ed 11 swift 0x0000000000edd06b 12 swift 0x0000000000ed14a0 ...
Version:
swift-3.0.2-RELEASE
Output:
Error:
0 swift 0x00000000035c3c08 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 swift 0x00000000035c4367 2 libpthread.so.0 0x00007f1c9a644390 3 swift 0x00000000011be630 swift::TypeBase::getDesugaredType() + 32 4 swift 0x000000000107ab85 swift::ArchetypeBuilder::resolveArchetype(swift::Type) + 21 5 swift 0x000000000107a598 swift::ArchetypeBuilder::PotentialArchetype::getType(swift::ArchetypeBuilder&) + 1400 6 swift 0x000000000107f6e7 swift::ArchetypeBuilder::getArchetype(swift::GenericTypeParamDecl*) + 167 7 swift 0x0000000000f6c87f swift::TypeChecker::finalizeGenericParamList(swift::ArchetypeBuilder&, swift::GenericParamList*, swift::DeclContext*) + 191 8 swift 0x0000000000f4173c 9 swift 0x0000000000f301a9 10 swift 0x0000000000f3d70b 11 swift 0x0000000000f3003b 12 swift 0x0000000000f2ffbd swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 157 ...
Version:
swift-3.1-RELEASE
Output:
[2, 3, 5]
Error:
Version:
swift-3.1.1-RELEASE
Output:
[2, 3, 5]
Error:
3:00 PM
3:00 PM