Why doesn't C # have a virtual call agreement?

Inspired by this SO question :

Why doesn't C # have a keyword for a non-virtual call?

EDIT: I mean "why is there no keyword for non-virtual IL calls, given that the C # compiler always uses virtual IL calls by default"?

+3
source share
2 answers

This may explain this: http://blogs.msdn.com/b/ericgu/archive/2008/07/02/why-does-c-always-use-callvirt.aspx

: call null this ( ++). , # callvirt , , null NullReferenceException

+2

# ?

. . , Java, . . , . , . .

. . : " , , , - ". , , , : " , ".

- , promises , . , , x y. API, , , , x y . , , .

, API, . OS API, . , API, promises. promises, , - .

: http://www.artima.com/intv/nonvirtual.html

+3

Source: https://habr.com/ru/post/1757468/


All Articles