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. 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 the default settings for the current project, 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, select the Options command from the Tools menu. When the Options dialog box appears, move to the Projects and Solutions tab and select ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.