Skip to content
New issue

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

error: use of unresolved identifier 'exit' #9

Closed
erkekin opened this issue Jan 6, 2018 · 2 comments
Closed

error: use of unresolved identifier 'exit' #9

erkekin opened this issue Jan 6, 2018 · 2 comments

Comments

@erkekin
Copy link

erkekin commented Jan 6, 2018

got this at first try, after copying and pasting beak.swift from the example in README.md

$ beak run install

Compile Swift Module 'BeakFile' (1 sources)
**/Users/----/Documents/beak/builds/_Users_icterra/Sources/BeakFile/main.swift:20:5: error: use of unresolved identifier 'exit'
    exit(1)
    ^~~~**

error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/----/Documents/beak/builds/_Users_icterra/.build/debug.yaml main
@yonaskolb
Copy link
Owner

Ah yes, I see. Because the functions are throwing the generated function call includes some error handling which has an exit, which requires an import of Foundation.

do {
    try \(functionCall)
} catch {
    print(error)
    exit(1)
}

I should automatically add the import if it's missing. In the meantime simply add import Foundation into your script.

@yonaskolb
Copy link
Owner

I've documented this for now 6547980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants