@module on an @instanceOf type is silently ignored
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
- 54/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, ocaml
- Área
- compilers
Línea de trabajo
Start by reading the compiler handling for @module, @scope, and @instanceOf type declarations, then trace the generated JavaScript for the example. Check how @module on an external declaration is represented and tested. Done means the class check either uses the imported or scoped class correctly, or the compiler rejects these attributes on a type declaration.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
@module on an @instanceOf type is silently ignored. The class check then reads a global with the class name, instead of importing the class from the module.
@instanceOf("Object3D") type object3D
@module("three") @instanceOf("Mesh") type mesh = private object3D
@unboxed
type shape = Mesh(mesh) | Other(object3D)
let isMesh = (s: shape) =>
switch s {
| Mesh(_) => true
| Other(_) => false
}
compiles without a warning to
function isMesh(s) {
return s instanceof Mesh;
}
There is no import of three. At runtime Mesh is not defined, so the check throws a ReferenceError, unless some other script happens to define a global Mesh.
Expected: either the check uses the imported class, like a @module("three") external would, or @module on a type declaration is a compile error.
@scope("THREE") is ignored the same way: the check is still s instanceof Mesh, not THREE.Mesh.
Raised in https://github.com/rescript-lang/rescript/issues/9058#issuecomment-6658655177. Classes from local files and JS libraries need this, not only the DOM.
- Lenguaje dominante
- OCaml
- Estrellas
- 7.5k
- Forks
- 485
- Merge medio
- 16 h 51 min
- PR fusionados (30 d)
- 268
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
-
Exception analysis does not know the Temporal `fromStringOrThrow` functionsPosiblemente ocupada @cknitt la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rescript-lang/rescript#9182 ·
Los mantenedores suelen responder en 1 día
-
Build system: make output wording and labels consistentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
rescript-lang/rescript#9244 ·
Los mantenedores suelen responder en 1 día
-
rescript format: aborts on a syntax error, unstable output, raw compiler errorsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
rescript-lang/rescript#9243 ·
Los mantenedores suelen responder en 1 día
-
Build system CLI: behavior that disagrees with the help textPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
rescript-lang/rescript#9242 ·
Los mantenedores suelen responder en 1 día
-
Build system: a failed first build forces full rebuilds, and clean breaks a running watchPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
rescript-lang/rescript#9241 ·
Los mantenedores suelen responder en 1 día
Todos los issues de rescript-lang/rescript
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
GaloisInc/llvm-pretty#211 ·
-
crash mlir
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
llvm/llvm-project#239604 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug good first issue self-hosted compiler
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
AeroForger/AeroFyl#1 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
KhronosGroup/SPIRV-LLVM-Translator#4151 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
anthropics/claudes-c-compiler#322 ·