Consider the following scenarios:
Works:
SemanticModel semanticModel;
document.TryGetSemanticModel(out semanticModel);
Does not work:
var semanticModel;
document.TryGetSemanticModel(out semanticModel);
Works:
document.TryGetSemanticModel(out SemanticModel semanticModel);
It works, BUT:
document.TryGetSemanticModel(out var semanticModel);
But : the code compiles, but when you hover over there is no intellectual information or documentation. Is the last method considered syntactic sugar for the second (which causes the error below) or is it more than simple?
Implicitly typed variables must be initialized
So, am I looking at an error in implementation or in Visual Studio?
source
share