Closed kdubb closed 1 year ago
@lickel This implements subscript properties in all their Swift glory. Use have to use a FunctionSignatureSpec
builder that allows you to create whatever crazy signature you need 😀
E.g.
PropertySpec
.subscriptBuilder(
FunctionSignatureSpec.builder()
.addTypeVariable(typeVariable("P").withBounds(TypeVariableName.Bound(typeName("Swift.StringProtocol"))))
.addParameter(
"index",
typeName("Swift.KeyPath")
.parameterizedBy(typeName(".BackingData"), typeVariable("P"))
)
.returns(typeVariable("P"))
.build()
)
.getter(...)
.setter(...)
.build()
that's awesome, thanks!
FunctionSignatureSpec
shared between properties and functionssubscriptBuilder(FunctionSignatureSpec)
factoryFixes #69