
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
51 lines
719 B
Plaintext
51 lines
719 B
Plaintext
== Why is this an issue?
|
|
|
|
For read-only computed properties and subscript declarations, the ``++get++`` keyword and its braces are optional, and should be omitted for the sake of brevity.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,swift]
|
|
----
|
|
struct Magic {
|
|
var number:Int {
|
|
get { // Noncompliant
|
|
return 42
|
|
}
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,swift]
|
|
----
|
|
struct Magic {
|
|
var number:Int {
|
|
return 42
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove the "get" keyword and its braces.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== is duplicated by: S3668
|
|
|
|
endif::env-github,rspecator-view[]
|