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
[SR-2373] Trailing doc comment should not be attached to the next declaration #44980
Comments
Doxygen has syntax for this— |
cc @bitjammer, @akyrtzi |
To quote @gribozavr from rdar://26982593: "It was a deliberate decision to not add “trailing comments” in Swift, because when I was implementing this feature for Clang, we found a ton of nasty corner-cases and non-intuitive behavior." |
How about just ignoring trailing comments, for now? Definition of "trailing comments": Comment which is not Example: decl1 /**
trailing
*/ /** not trailing, attached to `decl2` */ decl2 /** trailing */ /// trailing
/// not trailing, attached to `decl3`
decl3 |
Comment by Yasuhiro Inami (JIRA) I personally prefer: public class C {
public var i: Int = 1 /// FOO
public var j: Int = 1 /** BAR */
public var k: Int = 1
} or // Extra newline is added after trailing doc-comment
public class C {
public var i: Int = 1
/// FOO
public var j: Int = 1
/** BAR */
public var k: Int = 1
} be equivalent to this: public class C {
/// FOO
public var i: Int
/** BAR */
public var j: Int
public var k: Int
} And using extra symbol e.g. `///<` seems redundant to me. |
@swift-ci create |
Comment by Yasuhiro Inami (JIRA) Related: SR-9616 My previous comment in #comment-41118 should be modified that: // Extra newline is added after trailing doc-comment
public class C {
public var i: Int = 1
/// FOO
public var j: Int = 1
/** BAR */
public var k: Int = 1
} will NOT be the case of trailing-doc-comment |
Environment
Xcode Version 8.0 beta 6 (8S201h)
Additional Detail from JIRA
md5: 81805e4a3595d7dec2f0cb6dbd2cedff
relates to:
Issue Description:
Printing interface of this:
results:
I believe this is not a result the author intended.
The text was updated successfully, but these errors were encountered: