mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Resolves: https://bugs.swift.org/browse/SR-4426 * Make IfConfigDecl be able to hold ASTNodes * Parse #if as IfConfigDecl * Stop enclosing toplevel #if into TopLevelCodeDecl. * Eliminate IfConfigStmt
22 lines
416 B
Swift
22 lines
416 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 {}
|
|
|
|
// If '#if' contains active non-decls, we don't support forward reference.
|
|
typealias C = D // expected-error {{use of undeclared type 'D'}}
|
|
|
|
#if true
|
|
print("ok")
|
|
#endif
|
|
|
|
struct D {}
|