Swiftify-Corp / Swiftify

43 stars 24 forks source link

Local variables of type `id<SomeProtocol>` are incorrectly declared as `weak` #203

Closed amorde closed 2 years ago

amorde commented 2 years ago

Similar to #202

Input:

- (void)someFunction;
{
    id<SomeProtocol> value = [self makeSomeValue];
}

Result:

func someFunction() {
     weak var value = makeSomeValue()
}
alex-swiftify commented 2 years ago

@amorde Fixed (the changes will be available since the next converter update).

Converter output:

func someFunction() {
    let value = makeSomeValue()
}