TypeInfo (version 1.38.0)

ReturnTypeSpecification: Constructor for specifying information about only the return type

Description

This function is a constructor for a class that represents information only about the return type of a function and explicitly has no information about the parameters.

Usage

ReturnTypeSpecification(type, obj = new("ReturnTypeSpecification"))

Arguments

type
the type specification. This should be an object of class ClassNameOrExpression or coercible to one.
obj
the instance that is to be populated and returned.

Value

By default, an object of class ReturnTypeSpecification-class. However, it merely returns the value of obj after populating it with the value of type. So strictly the return value is the augmented value of obj.

See Also

IndependentTypeSpecification SimultaneousTypeSpecification

Examples

Run this code
 ReturnTypeSpecification(quote(length(x) == 3))

 ReturnTypeSpecification("matrix")

 ReturnTypeSpecification(new("StrictIsTypeTest", "matrix"))

Run the code above in your browser using DataLab