Files
swift-mirror/validation-test/IDE/crashers_fixed/assign-anyobject.swift
Alex Hoppen 5d01a097e1 [CodeCompletion] Don't distinguish convertible and idenical type relation
I think that preferring identical over convertible makes sense in e.g. C++ where we have implicit user-defined type conversions but since we don’t have them in Swift, I think the distinction doesn’t make too much sense, because if we have a `func foo(x: Int?)`, want don’t really want to  prioritize variables of type `Int?` over `Int` Similarly if we have `func foo(x: View)`, we don’t want to prioritize a variable of type `View` over e.g. `Text`.

rdar://91349364
2022-04-13 08:28:17 +02:00

6 lines
236 B
Swift

// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | %FileCheck %s
var bar: AnyObject
var foo: AnyObject
foo = #^A^#
// CHECK: Decl[GlobalVar]/Local/TypeRelation[Convertible]: foo[#AnyObject#];