I'm coming from a C# background and I really like the type inference that C# 3.0 has. I'm trying to do similar things in VB.NET (some of which appear possible), but in some cases the compiler seems to be not nearly as good at inferring the type.
For example, I have a method that returns an object of type System.Guid. In C# I'd do this and the variable 'i' would be of type Guid through inference.
var prop = RegisterProperty(Of Guid)(...);
However, if I do a similar thing in VB.NET:
Dim prop = RegisterProperty(Of Guid(...)
I get prop as type System.Object. I've played with some of the VB.NET project settings but the only thing it changes is whether I get a warning that the object is of type Object when I use it later as a Guid.
Any ideas? I'm thinking the use of generics should allow the compiler to tell beyond a doubt what type prop should be.