51 lines
651 B
Plaintext
51 lines
651 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,swift]
|
|
----
|
|
public class Foo {
|
|
private var foo : String
|
|
|
|
public func getFoo() -> String {
|
|
return foo
|
|
}
|
|
|
|
//...
|
|
|
|
}
|
|
|
|
var foo = Foo()
|
|
foo.getFoo() // what does this return?
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,swift]
|
|
----
|
|
public class Foo {
|
|
private var name : String
|
|
|
|
public func getName() -> String {
|
|
return name
|
|
}
|
|
|
|
//...
|
|
|
|
}
|
|
|
|
var foo = Foo();
|
|
foo.getName()
|
|
----
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|