Files
swift-mirror/test/IDE/complete_crossmodule.swift
Rintaro Ishizaki e388c4a381 [CodeCompletion] Get associatedtype constraints from ProtocolDecl::getRequirementSignature()
instead of AssociatedTypeDecl::getInherited() when checking if the
return type should be suggested as "opaque result type" in override
completion.

AssociatedTypeDecl::getInherited() is not serialized. So if the protocol
is declared in a module, it was never suggested as 'some' result.

rdar://problem/57245073
2020-01-08 17:37:42 -08:00

23 lines
761 B
Swift

// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Test.swift -I %t -code-completion-token=OPAQUE_RESULT | %FileCheck --check-prefix=OPAQUE_RESULT %s
// BEGIN MyModule.swift
public protocol HasAssocWithConstraint {
associatedtype AssocWithContraint: HasAssocWithConstraint
var value: AssocWithContraint { get }
}
// BEGIN Test.swift
import MyModule
struct MyValue: HasAssocWithConstraint {
var #^OPAQUE_RESULT^#
// OPAQUE_RESULT: Begin completions
// OPAQUE_RESULT-DAG: Decl[InstanceVar]/Super: value: some HasAssocWithConstraint;
// OPAQUE_RESULT: End completions
}