Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fail, When a model has a property named type #22

Closed
hanshantao opened this issue Feb 1, 2024 · 5 comments
Closed

build fail, When a model has a property named type #22

hanshantao opened this issue Feb 1, 2024 · 5 comments

Comments

@hanshantao
Copy link

Reproduce sample code:

@codable
class Foo: Codable {
var bar: String? = ""
var type: String = ""
}

when build xcode error message:
Use of 'type' refers to instance method rather than global function 'type(of:)' in module 'Swift'

@winddpan
Copy link
Owner

winddpan commented Feb 1, 2024

What is your Xcode and Swift version? I will try a test.

@hanshantao
Copy link
Author

Xcode 15.2 Swift 5.9

@winddpan
Copy link
Owner

winddpan commented Feb 1, 2024

My environment is the same, but I can't reproduce this issue, can you provide a MVP demo?

@hanshantao
Copy link
Author

ok
ReproDemo.zip
Another problem, when comments and code are on the same line, swift macro resolution gets stuck.
But It's swift marco bugs, swift issues swiftlang/swift#69962

@winddpan
Copy link
Owner

winddpan commented Feb 1, 2024

fixed in 1.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants