0

我有一个功能:

  function myFunction(n: number, s: string, n2: number): boolean {
    throw ''
  }

我使用 ramda 0.27.1 部分调用它:

  const curriedStringNon = curry(myFunction)(123, 'string')

但后来我错过了一些类型安全:

  curriedStringNon(123) // <- this is allowed which is expected
  curriedStringNon('string') // <- this errors as it should
  curriedStringNon() // <- but why is this allowed?

我不希望它编译,因为myFunction不能只用两个 args 调用:

  myFunction(123, 'string') // <- this also errors which is expected
4

0 回答 0