blob: 200d066c33be1f7841a220c22ba26f9eb6323241 [file] [log] [blame]
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
// REQUIRES: objc_interop
import Foundation
protocol A: RawRepresentable {}
extension A {
static func +(lhs: RawValue, rhs: Self) -> Self {
fatalError()
}
}
class Foo<Bar: NSObject> {
var foobar: Bar {
fatalError()
}
lazy var foo: () -> Void = {
// TODO: improve diagnostic message
_ = self.foobar + nil // expected-error {{'Foo<Bar>' requires that 'Bar' inherit from 'NSObject'}}
}
}