@module on an @instanceOf type is silently ignored
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 54/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript, ocaml
- Bereich
- compilers
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
@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.
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 485
- Ø Merge
- 16 Std. 51 Min.
- Gemergte PRs (30 T.)
- 268
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus rescript-lang/rescript
-
Exception analysis does not know the Temporal `fromStringOrThrow` functionsEvtl. vergeben @cknitt hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
rescript-lang/rescript#9182 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Build system: make output wording and labels consistentEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
rescript-lang/rescript#9244 ·
Maintainer antworten meist innerhalb von 1 Tag
-
rescript format: aborts on a syntax error, unstable output, raw compiler errorsEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
rescript-lang/rescript#9243 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Build system CLI: behavior that disagrees with the help textEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 43/100
rescript-lang/rescript#9242 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Build system: a failed first build forces full rebuilds, and clean breaks a running watchEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
rescript-lang/rescript#9241 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rescript-lang/rescript
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
GaloisInc/llvm-pretty#211 ·
-
crash mlir
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
llvm/llvm-project#239604 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue self-hosted compiler
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
AeroForger/AeroFyl#1 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
KhronosGroup/SPIRV-LLVM-Translator#4151 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
anthropics/claudes-c-compiler#322 ·