| title | -optioninfer | |||
|---|---|---|---|---|
| ms.date | 07/20/2015 | |||
| ms.prod | .net | |||
| ms.reviewer | ||||
| ms.suite | ||||
| ms.technology |
|
|||
| ms.topic | article | |||
| f1_keywords |
|
|||
| helpviewer_keywords |
|
|||
| ms.assetid | f6c09db1-0553-464a-abe3-d4510c61d6ed | |||
| caps.latest.revision | 19 | |||
| author | dotnet-bot | |||
| ms.author | dotnetcontent |
Enables the use of local type inference in variable declarations.
-optioninfer[+ | -]
| Term | Definition |
|---|---|
+ | - |
Optional. Specify -optioninfer+ to enable local type inference, or -optioninfer- to block it. The -optioninfer option, with no value specified, is the same as -optioninfer+. The default value when the -optioninfer switch is not present is also -optioninfer+. The default value is set in the Vbc.rsp response file. |
Note
You can use the -noconfig option to retain the compiler's internal defaults instead of those specified in vbc.rsp. The compiler default for this option is -optioninfer-.
If the source code file contains an Option Infer Statement, the statement overrides the -optioninfer command-line compiler setting.
-
Select a project in Solution Explorer. On the Project menu, click Properties.
-
On the Compile tab, modify the value in the Option infer box.
The following code compiles test.vb with local type inference enabled.
vbc -optioninfer+ test.vb Visual Basic Command-Line Compiler
-optioncompare
-optionexplicit
-optionstrict
Sample Compilation Command Lines
Option Infer Statement
Local Type Inference
Visual Basic Defaults, Projects, Options Dialog Box
Compile Page, Project Designer (Visual Basic)
/noconfig
Building from the Command Line