mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If failed constraint mentions member declaration which is not generic, it means that generic requirements came from context and should not be diagnosed by `diagnoseUnresolvedDotExprTypeRequirementFailure`. Resolved: rdar://problem/45511837
24 lines
502 B
Swift
24 lines
502 B
Swift
// 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'}}
|
|
}
|
|
}
|