p-x9 / AliasMacro

🎭 A Swift macros for defining aliases for types, functions, variables, etc.
MIT License
30 stars 0 forks source link

Allow custom access modifiers for alias #3

Closed p-x9 closed 1 year ago

p-x9 commented 1 year ago

Currently, the original access modifier is carried over to the alias.

@Alias("こんにちは")
public var hello: String = ""
// ↓ expand
public var こんにちは: String {
    get { hello }
    set {  hello = newValue }
}

I would like to be able to specify access modifiers for aliases as follows

@Alias("こんにちは", access: .private)
public var hello: String = ""
// ↓ expand
private var こんにちは: String {
    get { hello }
    set {  hello = newValue }
}