mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
23 lines
650 B
Swift
23 lines
650 B
Swift
// RUN: %batch-code-completion
|
|
|
|
extension Double {
|
|
var doubleOnlyMember: Double { self }
|
|
}
|
|
|
|
struct CustomInt: ExpressibleByIntegerLiteral {
|
|
public init() {}
|
|
public init(integerLiteral value: Int) { }
|
|
var customIntMember: CustomInt { .init() }
|
|
}
|
|
|
|
func test() {
|
|
let double: Double = 2.#^DOUBLE_CONTEXTUAL_TYPE^#
|
|
// DOUBLE_CONTEXTUAL_TYPE: Decl[InstanceVar]/CurrNominal/TypeRelation[Convertible]: doubleOnlyMember[#Double#];
|
|
|
|
let int: Int = 2.#^INT_CONTEXTUAL_TYPE^#
|
|
// INT_CONTEXTUAL_TYPE: Decl[InstanceVar]/CurrNominal: doubleOnlyMember[#Double#];
|
|
|
|
let customInt: CustomInt = 2.#^CUSTOM_INT^#
|
|
// CUSTOM_INT-NOT: customIntMember
|
|
}
|