Exception analysis does not know the Temporal `fromStringOrThrow` functions

Abierto Apto para principiantes
#9,182 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ocaml
Área
devtools

Línea de trabajo

La tabla de funciones que lanzan excepciones está en analysis/reanalyze/src/exn_lib.ml, aproximadamente en las líneas 114-190, y el issue menciona los ocho externals de Temporal fromStringOrThrow añadidos en #9094 que faltan en ella. Empieza leyendo cómo se escriben las entradas *OrThrow existentes allí y luego ejecuta rescript-tools reanalyze -exception sobre el fragmento de tres líneas del issue. Está terminado cuando las tres llamadas a Temporal se reportan como lanzando JsExn, no solo big.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Found by differential semantic drift analysis from b123b7c3 to c10223e8.

What is broken

let big = () => BigInt.fromStringOrThrow("x")
let date = () => Temporal.PlainDate.fromStringOrThrow("x")
let dur = () => Temporal.Duration.fromStringOrThrow("x")

rescript-tools reanalyze -exception reports only big might throw JsExn. #9094 added eight fromStringOrThrow externals (Duration, Instant, PlainDate, PlainDateTime, PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime); none is in the table of throwing library functions in exn_lib.ml, which lists every other stdlib *OrThrow function.

Temporal functions that throw without the OrThrow suffix (arithmetic out of range, invalid arguments to constructors) were not checked.

Possible cause (speculation only)

The table is maintained by hand next to the stdlib, and nothing checks that a new *OrThrow external has an entry.

🤖 Generated with Claude Code

Lenguaje dominante
OCaml
Estrellas
7.5k
Forks
484
Merge medio
17 h 2 min
PR fusionados (30 d)
249

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rescript-lang/rescript

Todos los issues de rescript-lang/rescript

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.