Untagged variant puts one typed array in another typed array's case
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- compilers
Línea de trabajo
Start with rule 5 in compiler/ml/UntaggedVariants.md and review the linked context in #8952 and #8950, which changes how the types are recognized. Reproduce the example with the two typed arrays and trace how their type names are used for run-time case checks. Done means the invalid overlap is rejected or the mismatched value becomes a type error.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
An untagged variant with cases for two typed arrays accepts a value of one typed array in the case of the other, and the value then matches the other case.
@unboxed type ta = I8(Int8Array.t) | U8(Uint8Array.t)
let f = v => switch v { | I8(_) => "i8" | U8(_) => "u8" }
Console.log(f(I8(Uint8Array.fromArray([1]))))
Output: u8.
The typed-array types are abbreviations of one type, so I8(Uint8Array…) type-checks. The cases are classified by the type name as written, so the run-time check is instanceof Uint8Array.
Expected: either the cases are distinct types, so that I8(Uint8Array…) is a type error, or the variant is rejected because two cases share one type.
The rule is compiler/ml/UntaggedVariants.md rule 5, in #8952. #8950 changes how these types are recognized.
- Lenguaje dominante
- OCaml
- Estrellas
- 7.5k
- Forks
- 483
- Merge medio
- 21 h 8 min
- PR fusionados (30 d)
- 183
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rescript-lang/rescript
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rescript-lang/rescript#8996 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
rescript-lang/rescript#8997 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 55/100
rescript-lang/rescript#8995 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
rescript-lang/rescript#8994 ·
Los mantenedores suelen responder en 1 día
-
Issues from differential semantic drift analysis (a7721303 to b123b7c3)Posiblemente ocupada @cknitt la tomó hoy. Abierto
rescript-lang/rescript#8980 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de rescript-lang/rescript
Issues similares
-
clang:frontend code-cleanup HLSL
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
llvm/llvm-project#235100 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
paritytech/polkavm#442 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
objectionary/phino#2075 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día