Port selected upstream OCaml type checker improvements (post 4.06)
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- ocaml
- Bereich
- compilers
Rechercherichtung
Start by reading the compiler sources under compiler/ml and compare the listed upstream changes with the specific behavior you want to port. The issue asks for each candidate to be a separate PR with tests and a changelog fragment; choose one candidate and use its stated files, such as includecore/includemod for diff-based inclusion errors. Done means the selected improvement is ported and covered by tests, with a changelog fragment.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
The type checker and pattern-match compiler in compiler/ml are a 4.06-era fork of OCaml. They have diverged a lot since then. Upstream has made several improvements in the meantime that would help ReScript users directly. This issue tracks the ones worth porting by hand. A full resync is not a goal.
Candidates, by value
- Diff-based inclusion errors (4.13,
Diffing). Signature mismatches name the record field or variant constructor that was added, removed, swapped or renamed, and the same goes for functor arguments. Today we print "Their kinds differ" or "Fields number N have different names"..resimismatches are common, and the change stays mostly withinincludecore/includemod. It needs a port by hand, because of our own error cases (Field_optional,Runtime_annotation,Not_undefined, …). - Shapes (4.14).
.cmtfiles record where each definition comes from, through functor applications,includeand module aliases. This would remove the analysis limitation for cross-file references through applied functors (see #9084). It is also the basis for project-wide find-references. Requires a cmt format change. - Matching on mutable fields under guards (upstream ocaml/ocaml#7241, unsound). We are affected: a failed guard that changes a mutable field can make
switchtake a case that does not match. Repro and details in #9129. Upstream fixed it in OCaml 5.3 (ocaml/ocaml#13138, ocaml/ocaml#13152). - Warning names (4.12). Accept names like
+unused-varnext to numbers in-wand inrescript.json. Cheap to add, and warning configs become readable. -
Parmatchimprovements. These can be picked one at a time. Counterexamples mention guarded clauses ("some guarded clause may match this value"). Unused cases inside or-patterns are detected more precisely. Refutation is faster. - Structured unification traces (
Errortrace, 4.14/5.0). These separate unification, equality and moregen failures, which gives more precise "not compatible" explanations. We have already rewritten many messages (error_message_utils), so the gain is smaller and touches more code. - Type scopes (4.08–4.11). Escape checks for locally abstract types and first-class modules would use a separate scope instead of levels. This is invasive (
ctype/typecore), so only worth it if escape bugs come up. - GADT soundness fixes (injectivity, 4.12, and others). Port these when a bug report needs one. GADTs are rare in ReScript code.
Out of scope
- Abstract
type_expr(4.14) and thewith_local_levelrefactor (5.1): a lot of churn, no user-visible gain. - Upstream error rendering (
Location.report): we have our owncode_frame. - Lambda/Simplif optimisations and Flambda: the JS backend has its own
Lampasses. - Language features that don't fit ReScript: binding operators, labeled tuples, effects, unboxed layouts and modes,
with module type. - Alerts (
[@alert]): would only be nice to have unless there is demand for categories beyond@deprecated.
Each checked item should be its own PR with tests and a changelog fragment where users can see the change.
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 484
- Ø Merge
- 21 Std. 9 Min.
- Gemergte PRs (30 T.)
- 255
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
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
rescript-lang/rescript#9135 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
rescript-lang/rescript#9132 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Printed type declarations drop @tag, @notUndefined and runtime annotationsEvtl. vergeben @cknitt hat das heute übernommen. Offen
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 25/100
rescript-lang/rescript#9134 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 55/100
rescript-lang/rescript#9122 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Dev dependencies interactingEvtl. vergeben @CarlOlson hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 25/100
rescript-lang/rescript#9089 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rescript-lang/rescript
Ähnliche Issues
-
confirmed generated by fuzzer llvm:codegen miscompilation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
llvm/llvm-project#237380 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Source comments still name the removed set_observer_thresholds and set_observer_scale builtinsOffenarea:observer area:trace-tape found-by:code-review kind:docs-drift
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
InauguralSystems/EigenScript#2212 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug medium priority openmp tokenizer wrong result
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
import: a segment starting with a digit is refused, but the error says digits are allowedEvtl. vergeben @sebastianbreguel hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
HigherOrderCO/Bend#1961 ·
-
bug pdd
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 60/100
objectionary/eo#9675 ·
Maintainer antworten meist innerhalb von 1 Tag