Type Inference in VB.net 9.0

Date July 28, 2007

I typed Dim x = New List(Of String) but on the next line I realized that the implicit type inference didn’t work and Intellisense treated x as Object.  It turns out, it was an easy fix.  You have to open the project properties and turn “Option infer” to On.  Or type

Option Infer On

at the top of your class.

 

kick it on DotNetKicks.com

Trackbacks

close Reblog this comment
blog comments powered by Disqus