mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Parsing of integer literals as generic arguments isn’t implemented in SwiftParser yet, blocking swift-syntax PR testing.
21 lines
948 B
Swift
21 lines
948 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend %s -emit-module -enable-experimental-feature ValueGenerics -enable-experimental-feature RawLayout -disable-availability-checking -disable-experimental-parser-round-trip -parse-as-library -o %t
|
|
// RUN: %target-sil-opt -enable-sil-verify-all %t/value_generics.swiftmodule -o - | %FileCheck %s
|
|
|
|
// CHECK: @_rawLayout(likeArrayOf: Element, count: Count) struct Vector<Element, let Count : Int> : ~Copyable where Element : ~Copyable {
|
|
@_rawLayout(likeArrayOf: Element, count: Count)
|
|
struct Vector<Element: ~Copyable, let Count: Int>: ~Copyable {}
|
|
|
|
// CHECK: extension Vector where Element == Int
|
|
extension Vector where Element == Int {
|
|
func something() {}
|
|
}
|
|
|
|
// CHECK: extension Vector where Count == 2
|
|
extension Vector where Count == 2 {
|
|
func something2() {}
|
|
}
|
|
|
|
// CHECK: func something<let N : Int>(_: borrowing Vector<Int, N>)
|
|
func something<let N: Int>(_: borrowing Vector<Int, N>) {}
|