We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default toolchain of Xcode 11.3.1 (11C504)
md5: 3f9adb11ddeabc3ca9a3eab89a9aeb68
Issue Description:
Program A (compiles and runs):
func foo() { { bar() }() if true { return } func bar() { print("bar") } } foo()
Since A compiles and runs, printing bar, I'd expect the following two programs B and C to compile and run too.
But program B will crash the compiler, and program C will result in a compile time error (which is inconsistent with program A being valid).
So either program A is an example of accepts invalid, or B and C should compile.
Program B (crashes compiler):
func foo() { { bar() }() //if true { return //} func bar() { print("bar") } } foo()
Program C (inconsistent error (given that A compiles)):
func foo() { //{ bar() // ERROR: Use of local variable 'bar' before its declaration //}() //if true { return //} func bar() { print("bar") } } foo()
Related forum post: https://forums.swift.org/t/improve-nested-functions-visibility-or-order-dependency/33935/8
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
No branches or pull requests
Environment
Default toolchain of Xcode 11.3.1 (11C504)
Additional Detail from JIRA
md5: 3f9adb11ddeabc3ca9a3eab89a9aeb68
Issue Description:
Program A (compiles and runs):
Since A compiles and runs, printing bar, I'd expect the following two programs B and C to compile and run too.
But program B will crash the compiler, and program C will result in a compile time error (which is inconsistent with program A being valid).
So either program A is an example of accepts invalid, or B and C should compile.
Program B (crashes compiler):
Program C (inconsistent error (given that A compiles)):
Related forum post:
https://forums.swift.org/t/improve-nested-functions-visibility-or-order-dependency/33935/8
The text was updated successfully, but these errors were encountered: