import Foundation
let filemgr = FileManager.default
let path = filemgr.currentDirectoryPath()
print(path)
and get erorr /main.swift:3:40: error: cannot call value of non-function type 'String'
let path = filemgr.currentDirectoryPath()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
The error tells you it's not a function, but a String. In other words, it's
a property of filemgr. Try calling it without the parentheses :).
···
On Wed, Feb 1, 2017 at 10:34 AM, Roman Pastushkov via swift-dev < swift-dev@swift.org> wrote:
Hello everyone!
I iam trying compile 4 lines prog on linux:
import Foundation
let filemgr = FileManager.default
let path = filemgr.currentDirectoryPath()
print(path)
and get erorr /main.swift:3:40: error: cannot call value of non-function
type 'String'
let path = filemgr.currentDirectoryPath()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
This is the kind of thing it'd be a good idea to have a fixit for. If either of you have time to file a bug to improve the diagnostic to suggest a fix, we'd appreciate it!
-Joe
···
On Feb 1, 2017, at 2:33 AM, Chris Eidhof via swift-dev <swift-dev@swift.org> wrote:
The error tells you it's not a function, but a String. In other words, it's a property of filemgr. Try calling it without the parentheses :).
>
> The error tells you it's not a function, but a String. In other words,
it's a property of filemgr. Try calling it without the parentheses :).
This is the kind of thing it'd be a good idea to have a fixit for. If
either of you have time to file a bug to improve the diagnostic to suggest
a fix, we'd appreciate it!
The original change actually emits the fixit. I also verified that the
-fixit-all emits a fix it to .remap.
···
On Wed, Feb 1, 2017 at 10:24 AM, Joe Groff via swift-dev < swift-dev@swift.org> wrote:
> On Feb 1, 2017, at 2:33 AM, Chris Eidhof via swift-dev < > swift-dev@swift.org> wrote: