mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Don't print typealiases that match generic params
These are synthesized to satisfy associated type requirements, but they're not needed in source, and they look like self-referential definitions (`typealias X = X`).
This commit is contained in:
20
test/ModuleInterface/conformances.swift
Normal file
20
test/ModuleInterface/conformances.swift
Normal file
@@ -0,0 +1,20 @@
|
||||
// RUN: %target-swift-frontend -emit-interface-path %t.swiftinterface -emit-module -o /dev/null %s
|
||||
// RUN: %FileCheck %s < %t.swiftinterface
|
||||
// RUN: %FileCheck -check-prefix NEGATIVE %s < %t.swiftinterface
|
||||
|
||||
// CHECK-LABEL: public protocol SimpleProto {
|
||||
public protocol SimpleProto {
|
||||
// CHECK: associatedtype Element
|
||||
associatedtype Element
|
||||
// CHECK: associatedtype Inferred
|
||||
associatedtype Inferred
|
||||
func inference(_: Inferred)
|
||||
} // CHECK: {{^}$}}
|
||||
|
||||
// CHECK-LABEL: public struct SimplImpl<Element> : SimpleProto {
|
||||
public struct SimplImpl<Element>: SimpleProto {
|
||||
// NEGATIVE-NOT: typealias Element =
|
||||
// CHECK: public func inference(_: Int){{$}}
|
||||
public func inference(_: Int) {}
|
||||
// CHECK: public typealias Inferred = Swift.Int
|
||||
} // CHECK: {{^}$}}
|
||||
Reference in New Issue
Block a user