37 lines
677 B
Plaintext
37 lines
677 B
Plaintext
Calling `ToString()` on an object should always return a string. Returning `Nothing` instead contravenes the method's implicit contract.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,vbnet]
|
|
----
|
|
Public Overrides Function ToString() As String
|
|
Return Nothing
|
|
End Function
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,vbnet]
|
|
----
|
|
Public Overrides Function ToString() As String
|
|
Return ""
|
|
End Function
|
|
----
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|