mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When computing the type of a potentially-overriden declaration, make sure we have an interface type. Add a test to ensure that we validate overrides cross-file correctly.
23 lines
751 B
Swift
23 lines
751 B
Swift
// Test that overrides in other source files get checked lazily.
|
|
|
|
// Make sure the overrides are resolved... but we don't diagnose a missing
|
|
// 'override' keyword from another source file.
|
|
// RUN: %target-swift-frontend -typecheck -primary-file %s %S/Inputs/overrideB.swift %S/Inputs/overrideC.swift -verify
|
|
|
|
// Make sure we still diagnose the missing 'override' when looking at the
|
|
// source file where it occurs.
|
|
// RUN: not %target-swift-frontend -typecheck %s %S/Inputs/overrideB.swift -primary-file %S/Inputs/overrideC.swift 2> %t.err
|
|
// RUN: %FileCheck %s < %t.err
|
|
|
|
// expected-no-diagnostics
|
|
|
|
class Foo {
|
|
func foo(sub: Sub) {
|
|
sub.bar(Into<Int>())
|
|
}
|
|
}
|
|
|
|
struct Into<T> { }
|
|
|
|
// CHECK: overriding declaration requires an 'override' keyword
|