Files
swift-mirror/test/decl/protocol/protocol_with_superclass_objc.swift
Slava Pestov 06c819d46e Sema: Allow protocols to inherit from subclass existentials
This was a regression from 7566f98a45.

Fixes <rdar://problem/50022955>.
2019-04-18 17:48:28 -04:00

17 lines
590 B
Swift

// RUN: %target-typecheck-verify-swift -enable-objc-interop
class Base {}
@objc protocol Protocol1 : Base {}
// expected-error@-1 {{inheritance from non-protocol type 'Base'}}
@objc protocol OtherProtocol {}
typealias Composition = OtherProtocol & Base
@objc protocol Protocol2 : Composition {}
// expected-error@-1 {{inheritance from class-constrained protocol composition type 'Composition' (aka 'Base & OtherProtocol')}}
@objc protocol Protocol3 : OtherProtocol & Base {}
// expected-error@-1 {{inheritance from class-constrained protocol composition type 'Base & OtherProtocol'}}