Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
VS 2017 ¿Error o nuevas características?

Después de actualizar a VS 2017, recibí el siguiente error de este código (que siempre ha funcionado perfectamente)

 byte[] HexStringToByteArray(string hex) { if (hex.Length % 2 == 1) throw new Exception("The binary key cannot have an odd number of digits"); byte[] arr = new byte[hex.Length >> 1]; for (int i = 0; i < hex.Length >> 1; ++i) // Error in this line { arr[i] = (byte)((GetHexVal(hex[i << 1]) << 4) + (GetHexVal(hex[(i << 1) + 1]))); } return arr; }

Excepción:

 Error 1: The variable 'i' cannot be used with type arguments Error 2: 'hex' is a variable but is used like a type

la solución fue rodear la expresión entre paréntesis.

 for (int i = 0; i < (hex.Length >> 1); ++i)

Pero eso me hizo preguntarme si esto es un error o una nueva funcionalidad. Gracias.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Gracias por informar esto. Esta es una regresión confirmada en la precedencia del análisis. Esta solución se enviará en la primera versión trimestral de VS2017 a más tardar.

Información sobre la corrección: https://github.com/dotnet/roslyn/pull/16834

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!