Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between <Literal> and <Object> in a Visual Studio snippet?

I've read the documentation on <Literal> and <Object>, and I understand that Literal is for values defined by the snippet, and Object is for values defined outside the snippet.

I also see that Object has an additional element, Type, which contains the type of variable that the declaration expects. I don't know how this element affects the resulting code though.

What is the functional difference between Literal and Object declarations, from the perspective of the person using the snippet?

like image 763
Kendall Frey Avatar asked Dec 03 '14 17:12

Kendall Frey


1 Answers

Functionally it's the same as the Literal type but it has an additional type constraint.

like image 130
CyberFox Avatar answered Nov 03 '22 10:11

CyberFox