Files
swift-mirror/test/multifile/override.swift
Doug Gregor 9939834a76 [Type checker] Validate potentially-overridden decls when needed.
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.
2018-07-04 22:45:10 -07:00

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