mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* When constructing instructions which have substitution maps: initialize those with the canonical SubstitutionMap * Also initialize SILFunction::ForwardingSubMap with the canonical one Non-canonical substitution maps may prevent generic specializations. This fixes a problem in Embedded Swift where an error is given because a function cannot be specialized, although it should. https://github.com/swiftlang/swift/issues/83895 rdar://159065157
14 lines
495 B
Swift
14 lines
495 B
Swift
// RUN: %target-run-simple-swift( -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none) | %FileCheck %s
|
|
// RUN: %target-run-simple-swift(-O -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
func f<V>(_ a: [V]) -> [String] {
|
|
return a.indices.map { String($0 /* as Int*/) } // adding `as Int` makes it compile
|
|
}
|
|
|
|
// CHECK: 0
|
|
print(f(["A"]).joined())
|
|
|