| Start |
|---|
| How to enable/disable it Document level It is on by default, but you can set it by placing Project level You can switch it on/off via the menu in Visual Studio: Project > [Project] Properties > Compile Tab > Option infer Choose All new projects You can switch it On by default for all new Projects by selecting: Tools > Options > Projects and Solutions > VB defaults > Option Infer Choose |
| What is it? Enables the use of local type inference in declaring variables. What is type inference? You can declare local variables without explicitly stating a data type. The compiler infers the data type of a variable from the type of its initialization expression. Option Infer On: vs. explicit type declaration: Option Infer Off: **Option Infer Off - Option Strict Off** **Option Infer Off - Option Strict On** |
| When to use type inference Basically you can use type inference whenever it is possible. Anonymous Type **Option Infer On** **Option Infer Off** Doubles/Decimals If another type like |
Read Article
https://develop.horje.com/learn/1434/reference