rspec/rules/S2225/vbnet/rule.adoc

39 lines
705 B
Plaintext

== Why is this an issue?
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[]