Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

error: use of unresolved identifier #25

Open
@schwa

Description

@schwa

This seems to be what I was seeing with #19.

I have a very simple and freshly generated package:

Example/Package.swift
Example/Sources/Example/Example.swift

Example.swift contains:

/*
```swift doctest
answer() // 42
```
*/
public func answer() -> Int {
    return 42
}

I run swift doctest from the Example directory as so:

swift doctest --verbose --package Sources/Example/Example.swift

And get the following error back out:

schwa@pan ~/D/Example> swift doctest --verbose --package Sources/Example/Example.swift
2020-05-08T08:24:06-0700 trace: Starting swift-doctest
2020-05-08T08:24:06-0700 debug: Swift launch path: /usr/bin/swift
2020-05-08T08:24:06-0700 debug: Swift launch arguments: ["run", "--repl"]
2020-05-08T08:24:06-0700 trace: Scanning /Users/schwa/Desktop/Example/Sources/Example/Example.swift for DocTest blocks
2020-05-08T08:24:06-0700 info: Found DocTest block at Sources/Example/Example.swift#3:1
answer() // 42
2020-05-08T08:24:07-0700 trace: Finished running tests.
2020-05-08T08:24:07-0700 trace: Printing test report in TAP format.
TAP version 13
1..1
not ok 1 - `answer()` produced an error
  ---
  actual: 'error: repl.swift:2:1: error: use of unresolved identifier ''answer''
  
    answer()
  
    ^~~~~~'
  column: 1
  file: Sources/Example/Example.swift
  line: 4
  ...
  ⏎                        

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions