mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Within the compiler, we use the term "layout constraint" for any constraint that affects the layout of a type parameter that has that constraint. However, the only user-visible constraint is "AnyObject", and calling that a layout constraint is confusing. Drop the term "layout" from diagnostics. Fixes rdar://problem/35295372.
12 lines
523 B
Swift
12 lines
523 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P1 : class { }
|
|
|
|
protocol P2 : class, class { } // expected-error{{redundant 'class' requirement}}{{20-27=}}
|
|
|
|
protocol P3 : P2, class { } // expected-error{{'class' must come first in the requirement list}}{{15-15=class, }}{{17-24=}}
|
|
// expected-warning@-1 {{redundant constraint 'Self' : 'AnyObject'}}
|
|
// expected-note@-2 {{constraint 'Self' : 'AnyObject' implied here}}
|
|
|
|
struct X : class { } // expected-error{{'class' constraint can only appear on protocol declarations}}
|