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

[SR-10676] Cannot Access Internal Code from SPM Modules in REPL #4862

Closed
swift-ci opened this issue May 13, 2019 · 1 comment
Closed

[SR-10676] Cannot Access Internal Code from SPM Modules in REPL #4862

swift-ci opened this issue May 13, 2019 · 1 comment
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-10676
Radar None
Original Reporter calebkleveter (JIRA User)
Type Bug
Status Resolved
Resolution Invalid
Environment

Swift 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.4) [REPL]

macOS 10.14.4 (18E226)

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift, Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 1469ee70b760a7d4bb3eb5472d17ec18

Issue Description:

I have a Vapor application that I am running in the Swift REPL using the --repl flag. I expect that when I then import one of the modules from this app, that I can not only access public code, but internal code also, considering the REPL will most likely be used for testing. But no, I can't do that.

I then tried to enable testing by passing in the -Xswiftc -enable-testing flags and importing my modules with the @testable attribute, but that didn't do the trick.

This behavior can be displayed with any project module with internal code. Here is an [example project on GitHub|https://github.com/calebkleveter/REPLTest].

@belkadan
Copy link

This is by design. The REPL is an environment for using other people's libraries as much as it is one for playing with your own; if not compiled with -enable-testing, the internal entry points may not even exist in the final binary.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants