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

213
Views
por qué el tipo '[]' no satisface los parámetros de restricción

Quiero declarar este tipo de función:

 function currying1 (fn: any, params: any) { if(fn.length <= params.length){ return fn(...params) } return (...p: any) => currying1(fn, [...params, ...p]) }

Entonces trato de declarar:

 type Parameters2<T> = T extends (...args: infer P) => any ? Partial<P> : never declare function Currying2<Fn extends (...args: any[]) => any, P extends Parameters2<Fn> = []>(fn: Fn, params: Parameters2<Fn>): any

Quiero establecer el valor predeterminado de P en [], pero recibo este tipo de error

El tipo '[]' no satisface la restricción 'Parameters2'. (2344)

Zona de juegos con código (El error está en la línea 64)

about 4 years ago · Juan Pablo Isaza
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!