Cuckoo icon indicating copy to clipboard operation
Cuckoo copied to clipboard

Issue with variable name as `extension`

Open levantAJ opened this issue 2 years ago • 1 comments

Hi team I ran into an issue in my class there is a variable named extension, when generating the mocks I get this error message

Getter/setter can only be defined for a single variable
Keyword 'extension' cannot be used as an identifier here
If this name is unavoidable, use backticks to escape it

The class looks like:

class PurchasePathInterfaceProxy: NSObject, PurchasePathInterface {
    var `extension`: PurchasePathExtension?

    var isBrowserEnabled: Bool = false

    func fetch(request: PurchasePathRequest, completion: @escaping (PurchasePath?, Error?) -> Void) {
    }
}
Screenshot 2023-12-19 at 16 31 35

levantAJ avatar Dec 19 '23 09:12 levantAJ

It seems like the support for escaping keywords wasn't extended to property names. I assume that it was merely forgotten.

I'll fix this for the upcoming 2.0 release. Thanks for noticing this! 🙂

MatyasKriz avatar Dec 19 '23 13:12 MatyasKriz