@notUndefined in an interface is not checked against the implementation
Los mantenedores suelen responder en 1 día
Ya se ha fusionado un pull request relacionado.
- #8966 de @cknitt — fusionado
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- ocaml
- Área
- compilers
Línea de trabajo
Start with compiler/ml/UntaggedVariants.md, rule 13, and the linked discussion in #8952, which describe the current interface inclusion behavior. Then trace inclusion checks for @notUndefined across interfaces, functor arguments, and with type constraints. Done means implementations whose types can hold undefined are rejected while the listed valid implementation types remain accepted; linked pull request #8966 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
An interface can declare an abstract type @notUndefined while its implementation is a type that holds undefined. Interface inclusion does not compare the attribute, so clients unbox option of the type, and Some(None) becomes None.
// M.resi
@notUndefined type t
let none: t
// M.res
type t = option<int>
let none: t = None
// C.res
@inline(never) let id = x => x
let o: option<M.t> = id(Some(M.none))
Console.log2(
"Some(none) is",
switch o {
| Some(_) => "Some"
| None => "None"
},
)
Output on master: Some(none) is None. C builds Some(M.none) as M.none itself, which is undefined.
Expected: the implementation is rejected, because type t = option<int> can hold undefined, which the interface rules out. An implementation satisfies @notUndefined when its own type cannot hold undefined: it is @notUndefined itself, a record, a builtin type other than option/unit, or a type declared with @instanceOf/@typeOf (#8950).
The same holds for functor arguments and with type constraints. compiler/ml/UntaggedVariants.md (rule 13, #8952) states that inclusion does not compare @notUndefined.
- Lenguaje dominante
- OCaml
- Estrellas
- 7.5k
- Forks
- 483
- Merge medio
- 20 h 7 min
- PR fusionados (30 d)
- 227
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 4/5 3-5 días Aptitud para principiantes 57/100
rescript-lang/rescript#9063 ·
Los mantenedores suelen responder en 1 día
-
Formatter moves a line comment in a switch/if/loop operand into the blockPosiblemente ocupada @cknitt la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rescript-lang/rescript#9060 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
rescript-lang/rescript#9058 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
RFC: Temporal API bindingsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
rescript-lang/rescript#9044 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
rescript-lang/rescript#9006 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de rescript-lang/rescript
Issues similares
-
area:codegen backend:metal bug direction:output
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
JS_SetPropertyInternal2 loses the value when a lazy property on the prototype runs out of memoryAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quickjs-ng/quickjs#1852 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
manuscript-lang/manuscript#1604 ·
Los mantenedores suelen responder en 1 día
-
rust testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
NekomyaDev/nudge#275 ·
Los mantenedores suelen responder en 1 día
-
jit: find libvx_cuda_dispatch next to vxc, as the runtime library isPosiblemente ocupada @hiraditya la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día