Signature does not compare @as tags of variant cases with payloads
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- compilers
Rechercherichtung
Start with rule 14 in compiler/ml/UntaggedVariants.md, linked from the issue, and compare its handling of nullary cases with payload cases. Then trace the compiler's interface inclusion checks for variant cases. Done means implementations that change payload case @as tags are rejected, matching the behavior for nullary cases.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
A signature does not compare the @as tags of a variant's cases with payloads. An implementation that swaps the tags passes the signature, and its values match the wrong constructor through the signature.
module M: {
type t = A({x: int}) | C({x: int})
let a: t
} = {
type t = | @as("C") A({x: int}) | @as("A") C({x: int})
let a = A({x: 1})
}
Console.log(switch M.a { | M.A(_) => "A" | M.C(_) => "C" })
Output: C.
Expected: the implementation is rejected, because its cases' tags differ from the signature's, as they are for nullary cases.
Interface inclusion compares the literals of nullary cases only. The rule is compiler/ml/UntaggedVariants.md rule 14, in #8952.
- Vorherrschende Sprache
- OCaml
- Sterne
- 7.5k
- Forks
- 483
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 169
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 77/100
rescript-lang/rescript#8953 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
rescript-lang/rescript#8955 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 55/100
rescript-lang/rescript#8954 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
rescript-lang/rescript#8947 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Untagged variant with Blob and File cases never matches File when Blob is declared firstEvtl. vergeben @cknitt hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
rescript-lang/rescript#8938 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in rescript-lang/rescript
Ähnliche Issues
-
REPL and --show-tokens abort with "Token conversion not implemented yet" on .xor., byte and in outOffenbug low priority tokenizer
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
WebAssembly/spec#2300 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
bug priority: P2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
confirmed generated by fuzzer llvm:optimizations miscompilation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
llvm/llvm-project#234325 ·
Maintainer antworten meist innerhalb von 1 Tag