You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The array types are correct, but the necessary type casts are missing.
This issue seems to only affect integer values, which need to be explicitly cast to the appropriate types.
usingSystem;usingSystem.Linq;usingMicrosoft.VisualBasic.CompilerServices;// Install-Package Microsoft.VisualBasicpublicpartialclassTestClass{publicvoidGenerateFromConstants(){float[]floatArr=Enumerable.Repeat(1.0f,5).ToArray();double[]doubleArr=Enumerable.Repeat(2.0d,5).ToArray();decimal[]decimalArr=Enumerable.Repeat(3.0m,5).ToArray();}publicvoidGenerateFromCasts(){float[]floatArr=Enumerable.Repeat(1,5).ToArray();double[]doubleArr=Enumerable.Repeat(2,5).ToArray();decimal[]decimalArr=Enumerable.Repeat(3,5).ToArray();}}3 target compilation errors:CS0029:Cannotimplicitlyconverttype 'int[]' to 'float[]'
CS0029:Cannot implicitly convert type 'int[]' to 'double[]'
CS0029:Cannot implicitly convert type 'int[]' to 'decimal[]'
The array types are correct, but the necessary type casts are missing.
This issue seems to only affect integer values, which need to be explicitly cast to the appropriate types.
VB.Net input code
Erroneous output
Expected output
Details
The text was updated successfully, but these errors were encountered: