mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
rdar://problem/17198298 - Allow 'static' in protocol property and func requirements, but not 'class'. - Allow 'static' methods in classes - they are 'class final'. - Only allow 'class' methods in classes (or extensions of classes) - Remove now unneeded diagnostics related to finding 'static' in previously banned places. - Update relevant diagnostics to make the new rules clear. Swift SVN r24260
16 lines
423 B
Swift
16 lines
423 B
Swift
// RUN: %target-swift-frontend %s -emit-sil -verify
|
|
|
|
// Distributed under the terms of the MIT license
|
|
// Test case submitted to project by http://github.com/valfer (Valerio Ferrucci)
|
|
|
|
protocol C {
|
|
static func c(o: AnyObject) -> Self?
|
|
}
|
|
func d<A,B>(a : A, f : A -> B) -> B {
|
|
} // expected-error {{missing return in a function expected to return 'B'}}
|
|
class D<A:C> {
|
|
func e(o: AnyObject) {
|
|
d(o, A.c)
|
|
}
|
|
}
|