Este producto no es compatible con el sitio Datadog seleccionado. ().
Esta página aún no está disponible en español. Estamos trabajando en su traducción. Si tienes alguna pregunta o comentario sobre nuestro actual proyecto de traducción, no dudes en ponerte en contacto con nosotros.
When a variable is marked dynamic, the compiler does not validate that the right operand of bitwise or shift operations is valid, which can lead to an unexpected run-time exception. This rule checks that the right operand of bitwise and shift operations is of type int, sbyte, byte, short, ushort, or char.
Input:
dynamicdyn=4;// The next line causes a run-time exception:varshifted=dyn<<2.0;
Output:
Run-time exception (line 6): Operator '<<' cannot be applied to operands of type 'int' and 'double'\
Stack Trace:\
[Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '<<' cannot be applied to operands of type 'int' and 'double']\
at CallSite.Target(Closure , CallSite , Object , Double )\
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)\
at Program.Main()