> VBA will compile the following code, but will cause an error at run-time:
```vb
Function Foo() As Collection
Set Foo = Excel.Application
End Function
```
RD should be able to determine whether the type of the return value assignment is a compatible type. There will need to be some consideration of polymorphism with regard to interfaces, and also possibly with special case objects like Controls and document-type modules.
There might also need to be special handling for `Object`