[
https://issues.apache.org/jira/browse/THRIFT-3812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15337734#comment-15337734
]
ASF GitHub Bot commented on THRIFT-3812:
----------------------------------------
Github user mfrawley commented on the issue:
https://github.com/apache/thrift/pull/1002
@apocolipse Like the ideas. Protocols can't be nested under a struct. You
get:
```
error: declaration is only valid at file scope protocol MyService {}
```
I like the Swift packages suggestion (which unfortunately are not in a
stable Swift release yet). Frameworks influence app startup time and
Cocoapods/Carthage already provide this functionality with podspecs (we use
Cocoapods atm).
A bigger issue we've run into when updating (since we generate code for
6+ client langs) is that we have property naming collisions .e.g. .code in
subtypes of NSError had to be renamed to errorCode, or .description. Being able
to have some way of dealing with that would be nice. One possible solution
might be a language-specific alias e.g. generate 'errorCode' for Swift, but
leave it as 'code' for other langs. That would avoid having to uglify all
client code with manually prefixed names. It's a different issue I know but
it's also name-collision related, and has cost me some considerable effort.
> Option to prefix namespace to Swift type names
> ----------------------------------------------
>
> Key: THRIFT-3812
> URL: https://issues.apache.org/jira/browse/THRIFT-3812
> Project: Thrift
> Issue Type: New Feature
> Components: Swift - Compiler
> Reporter: HÃ¥kon Hitland
> Priority: Minor
>
> Swift does have a way to namespace things within a pod, which can lead to
> name collisions.
> This adds an option "swift:prefix_namespace" that will add Cocoa-style
> prefixes to the generated code if the file has a defined Swift namespace.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)