Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
macOS 10.15.7 (19H512)
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug, TypeChecker
Assignee
None
Priority
Medium
md5: 9dbbf6ed0b72d73f5e9da1e76669ab5c
relates to:
SR-13306 Incorrect shadowing behavior for local functions and outer function parameters
Issue Description:
funcfoo() ->Int {
let bar =10funcbar(number: Int) ->Int { return number }
returnbar(number: bar)
// ^// error: cannot call value of non-function type 'Int'
}
Type-checking is fine until the argument is given to the local function:
funcfoo() ->Int {
let bar =10funcbar(number: Int) ->Int { return number }
returnbar(number:)
// ^~~~~~~~~~~~// error: cannot convert return expression of type '(Int) -> Int' to return type 'Int'
}
The text was updated successfully, but these errors were encountered:
Environment
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
macOS 10.15.7 (19H512)
Additional Detail from JIRA
md5: 9dbbf6ed0b72d73f5e9da1e76669ab5c
relates to:
Issue Description:
Type-checking is fine until the argument is given to the local function:
The text was updated successfully, but these errors were encountered: