Jordan Carlyon
03/30/2020, 6:27 PMsealed class Result<out R>The general rule is: when a type parameterof a classTis declared out, it may occur only in out-position in the members ofC, but in returnCcan safely be a supertype ofC<Base>.C<Derived>
In “clever words” they say that the classSo I can see that type parameteris covariant in the parameterC, or thatTis a covariant type parameter. You can think of C as being a producer of `T`'s, and NOT a consumer of `T`’s.T
RResultResultErrortoStringRReferences to functions, properties, and constructors, apart from introspecting the program structure, can also be called or used as instances of function types.
The common supertype for all callable references isBut I am not sure what that is or why it matters here. Is this applicable to this sealed class or is this not considered a callable reference since it is a sealed class? Is the constructor the callable reference and then the return type is, whereKCallable<out R>is the return value type, which is the property type for properties, and the constructed type for constructors.R
Change<R>itnoles
03/30/2020, 6:40 PMitnoles
03/30/2020, 6:41 PMJordan Carlyon
03/31/2020, 1:19 AM