In C# 6.0 you can write this:
var instance = default(object);
var type = typeof(object);
They have the same result of:
var instance = default(System.Object);
var type = typeof(System.Object);
But you can't write this:
var name = nameof(object);
It generates the following error:
Invalid expression term 'object'.
But you can still write this:
var name = nameof(System.Object);
Why nameof(object)
does not compile?