mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Currently if member has been found through same-type constraint it would only be properly handled when it comes from a class type, because that's the only time when base type gets replaced with "concrete" type from equivalence class, but nested types could also come from structs, enums and sometimes protocols (e.g. typealias) which `resolveDependentMemberType` has to handle. Resolves: rdar://problem/47334176
14 lines
584 B
Swift
14 lines
584 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t/rdar47334176_types.swiftmodule %S/Inputs/rdar47334176_types.swift
|
|
// RUN: %target-swift-frontend -I %t -typecheck %s
|
|
|
|
import rdar47334176_types
|
|
|
|
// To test all possibilities let's declare one of the types
|
|
// in the same module as function declaration which uses it.
|
|
struct S<V> : R {}
|
|
|
|
func foo<T : P, U>(_: T?, _: (T.V.V) -> Void) where T.V == E<U> {} // Ok
|
|
func bar<T : P, U>(_: T?, _: (T.V.V) -> Void) where T.V == S<U> {} // Ok
|
|
func baz<T : P, U>(_: T?, _: (T.V.V) -> Void) where T.V == C<U> {} // Ok
|