jsr icon indicating copy to clipboard operation
jsr copied to clipboard

Wrong error with `default export <expression> as type`

Open nicolo-ribaudo opened this issue 1 year ago • 0 comments

➜ deno publish --dry-run
Check file:///home/nic/Documents/dev/experiments.localhost/decimal-literal/src/index.ts
Checking for slow types in the public API...
error[unsupported-default-export-expr]: default export expression was too complex
  --> /home/nic/Documents/dev/experiments.localhost/decimal-literal/src/index.ts:71:1
   | 
71 | export default createDecimalTag<DecimalConstructor>(
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 |   undefined as never
   | ^^^^^^^^^^^^^^^^^^^^
73 | ) as DecimalTag<Decimal>;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   = hint: add an 'as' clause with an explicit type after the expression, or extract to a variable

  info: fast check was unable to infer the type of the default export expression
  docs: https://jsr.io/go/slow-type-unsupported-default-export-expr

The expression is already annotated with as, the error message should either not be there or tell me to do something different.

nicolo-ribaudo avatar Apr 28 '24 19:04 nicolo-ribaudo