Files
swift-mirror/test/Parse/ConditionalCompilation/pound-if-top-level-4.swift
Slava Pestov 1df3d1a33c Frontend: Don't interleave parsing and typechecking for the main file
SIL files still require this behavior; if we cleaned that up we
could simplify a fair bit of code here.

Fixes <https://bugs.swift.org/browse/SR-284>,
<https://bugs.swift.org/browse/SR-4426>.
2019-12-05 08:45:55 -05:00

21 lines
292 B
Swift

// RUN: %target-typecheck-verify-swift
// https://bugs.swift.org/browse/SR-4426
// '#if' in top-level code that contains only decls should not disturb forward reference.
typealias A = B
#if false
func foo() {}
#endif
struct B {}
typealias C = D
#if true
print("ok")
#endif
struct D {}