Weaver icon indicating copy to clipboard operation
Weaver copied to clipboard

Importing Individual Declarations is not supported

Open petropavel13 opened this issue 3 years ago • 1 comments

B.swift

import class Foundation.NSData

final class B {
    @Weaver(.reference)
    private var dependency: A
}

Weaver.swift

import class

// swiftlint:disable all
/// This file is generated by Weaver 1.0.7
/// DO NOT EDIT!

...

https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#grammar_import-declaration

https://nshipster.com/import/#importing-individual-declarations

petropavel13 avatar Jun 15 '22 10:06 petropavel13

@petropavel13 Thanks for the feedback.

For now you'll have to drop the class keyword and change the syntax to:

import Foundation.NSData

and even then, the Weaver file is going to add import Foundation instead of import Foundation.NSData.

I will leave this issue open to track this bug.

StephaneMagne avatar Jun 15 '22 17:06 StephaneMagne