Decybel07 / L10n-swift

Localization of the application with ability to change language "on the fly" and support for plural form in any language.
MIT License
315 stars 32 forks source link

Get compilation error "Cannot convert value of type 'Int' to expected argument type 'L10n'" #36

Closed gwynjudd closed 1 year ago

gwynjudd commented 1 year ago

Short description of the issue.

I get this build error (but only on one machine):

image

On a different machine, the identical code does not error and works just as expected.

The SupportConnectionError is defined thus:

image

I found that on the machine on which the error is occurring, the Pods/Manifest.lock has got a different version for L10n-swift (the one without the error has 5.7.3) :

image

Has there been a change between these two versions which would cause this error to occur?

What did you expect to happen?

I expect it to build as expected without the error. Honestly I'm a bit stuck - I'm not really an expert on Swift, but it baffles me why this error is appearing only on one machine. Any ideas that can help would be appreciated.

How to reproduces this problem?

It is hard to say. Like I said it only seems to happen on one particular machine.

Environment.

The environment should be basically the same. Both are using xCode 14.2, and the code is built from the same source.

DebugDescription

Happy to do so if required? But since it is a build error, I don't know it would be relevant

L10n-swift version: 5.7.3 (works) 5.9.0 (errors)

Xcode version:

❯ xcodebuild -version Xcode 14.2 Build version 14C1

Swift version:

❯ swift -version swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) Target: x86_64-apple-macosx12.

Platform(s):

File format(s):

Installation method:

gwynjudd commented 1 year ago

Sorry I think I found the change - https://github.com/Decybel07/L10n-swift/commit/68a6aa8d8aa9706f0743cddc7d7995b38f209ad4

It seems like an intentional change:

image

Any suggestions on how to fix up my code?

Decybel07 commented 1 year ago

Thank you for your Feedback. You will find the solution below ;)

"errorStatus".l10n(arg: status)