Option Infer Directive
To enable or disable local type inference, the Visual Basic grammar provides the Option Infer directive. Option Infer On enables inference whereas Option Infer Off disables it. Generally you do not need to explicitly provide an Option Infer directive because it is offered at the project level by Visual Studio. By default, Option Infer is On. If you want to change default settings for the current project, simply open My Project and then switch to the Compile tab. There you can find the Visual Basic compiler options including Option Infer. If you instead want to change settings for each new project, simply choose the Options command from the Tools menu. When the Options dialog appears, move to the Projects and Solutions
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access