<s>
C#	B-Application
4.0	O
is	O
a	O
version	O
of	O
the	O
C#	B-Application
programming	O
language	O
that	O
was	O
released	O
on	O
April	O
11	O
,	O
2010	O
.	O
</s>
<s>
Microsoft	O
released	O
the	O
4.0	O
runtime	B-Device
and	O
development	O
environment	O
Visual	O
Studio	O
2010	O
.	O
</s>
<s>
The	O
major	O
focus	O
of	O
C#	B-Application
4.0	O
is	O
interoperability	O
with	O
partially	O
or	O
fully	O
dynamically	O
typed	O
languages	O
and	O
frameworks	O
,	O
such	O
as	O
the	O
Dynamic	B-Application
Language	I-Application
Runtime	I-Application
and	O
COM	B-Application
.	O
</s>
<s>
The	O
following	O
new	O
features	O
were	O
added	O
in	O
C#	B-Application
4.0	O
.	O
</s>
<s>
A	O
new	O
pseudo-type	O
dynamic	O
is	O
introduced	O
into	O
the	O
C#	B-Application
type	O
system	O
.	O
</s>
<s>
This	O
is	O
known	O
as	O
duck	B-Application
typing	I-Application
.	O
</s>
<s>
Dynamic	O
lookup	O
is	O
performed	O
using	O
three	O
distinct	O
mechanisms	O
:	O
COM	B-Application
IDispatch	B-Application
for	O
COM	B-Application
objects	I-Application
,	O
IDynamicMetaObjectProvider	O
DLR	O
interface	O
for	O
objects	O
implementing	O
that	O
interface	O
,	O
and	O
reflection	B-Language
for	O
all	O
other	O
objects	O
.	O
</s>
<s>
Any	O
C#	B-Application
class	O
can	O
therefore	O
intercept	O
dynamic	O
calls	O
on	O
its	O
instances	O
by	O
implementing	O
IDynamicMetaObjectProvider	O
.	O
</s>
<s>
In	O
case	O
of	O
dynamic	O
method	O
and	O
indexer	O
calls	O
,	O
overload	O
resolution	O
happens	O
at	O
run-time	O
according	O
to	O
the	O
actual	O
types	O
of	O
the	O
values	O
passed	O
as	O
arguments	O
,	O
but	O
otherwise	O
according	O
to	O
the	O
usual	O
C#	B-Application
overloading	O
resolution	O
rules	O
.	O
</s>
<s>
Generic	B-Language
interfaces	O
and	O
delegates	O
can	O
have	O
their	O
type	O
parameters	O
marked	O
as	O
covariant	O
or	O
contravariant	O
using	O
keywords	O
out	O
and	O
in	O
respectively	O
.	O
</s>
<s>
The	O
ref	O
keyword	O
for	O
callers	O
of	O
methods	O
is	O
now	O
optional	O
when	O
calling	O
into	O
methods	O
supplied	O
by	O
COM	B-Application
interfaces	O
.	O
</s>
<s>
C#	B-Application
4.0	O
introduces	O
optional	O
parameters	O
with	O
default	O
values	O
as	O
seen	O
in	O
Visual	B-Language
Basic	I-Language
and	O
C++	B-Language
.	O
</s>
<s>
Optional	O
parameters	O
make	O
interoperating	O
with	O
COM	B-Application
easier	O
.	O
</s>
<s>
Previously	O
,	O
C#	B-Application
had	O
to	O
pass	O
in	O
every	O
parameter	O
in	O
the	O
method	O
of	O
the	O
COM	B-Application
component	O
,	O
even	O
those	O
that	O
are	O
optional	O
.	O
</s>
<s>
Indexed	O
properties	O
(	O
and	O
default	O
properties	O
)	O
of	O
COM	B-Application
objects	I-Application
are	O
now	O
recognized	O
,	O
but	O
C#	B-Application
objects	O
still	O
do	O
not	O
support	O
them	O
.	O
</s>
