icsharpcode / ILSpy

.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
21.45k stars 3.35k forks source link

(are you missing a cast?) #644

Closed Dashdemir closed 7 years ago

Dashdemir commented 9 years ago

A fragment of the IL code: ldloc.0 ldloc.1 ldarg.1 ldloc.2 ldc.i4.1 add ldelem.u1 ldc.i4.s 64 add conv.u1 stelem.i1 decompilers as: array[num] = buffer[i + 1] + 64; but should be: array[num] = (byte) (buffer[i + 1] + 64); otherwise the compiler SharpDevelop4.4 returns an error: Error CS0266: Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)

dgrunwald commented 7 years ago

This was fixed in the new decompiler engine (which just landed on the master branch).