mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
18 lines
365 B
Swift
18 lines
365 B
Swift
// RUN: %target-run-simple-swift | %FileCheck %s
|
|
// REQUIRES: executable_test
|
|
|
|
// Check that subscripts and functions named subscript can exist side-by-side
|
|
struct Foo {
|
|
subscript() -> String {
|
|
return "subscript"
|
|
}
|
|
|
|
func `subscript`() -> String {
|
|
return "func"
|
|
}
|
|
}
|
|
|
|
let f = Foo()
|
|
print(f[]) // CHECK: subscript
|
|
print(f.subscript()) // CHECK: func
|