Rule 17s-match
Matches
(17)
TeX source
\defnrule[r:s-match]
{\jdg{C}{\mrule}{\tau} \premsep \opt{\jdg{C}{\match}{\tau}}}
{\jdg{C}{\mrule\ \opt{\kw{;}\ \match}}{\tau}}Tests (12)
- elm / CompilerIssue1789RankCrashMissingJustTestA missing `Just` in a case branch crashes the type checker with `[rank = 1]`.
- elm / CompilerIssue2108IfBranchExtensibleRecordHangTest`if` branches of incompatible extensible-record function types must be rejected with a type error, not hang the compiler.
- elm / CompilerIssue2112CaseBranchInfiniteTypeHangTest`case` branches that could only agree through an infinite type must be rejected with a type error, not hang the compiler.
- elm / MinimalCaseTestA case expression with one rule whose pattern is a variable.
- elm / TypeMismatchIfBranchTestThe compiler rejects an `if` whose `then` branch is a number and whose `else` branch is a `String`, with a TYPE MISMATCH error.
- elm / TypeMismatchNumberRightOfAndTestA number as the right operand of `&&` (`True && 1`) is rejected with a TYPE MISMATCH error, because `&&` takes two `Bool`s.
- elm / TypeMismatchNumberRightOfOrTestA number as the right operand of `||` (`True || 1`) is rejected with a TYPE MISMATCH error, because `||` takes two `Bool`s.
- elm / TypeMismatchSecondCasePatternTestA `case` on a `String` whose second pattern is a `Char` literal is rejected with a TYPE MISMATCH.
- elm / TypeMismatchThirdCaseBranchTestA `case` whose third branch returns a number while the first two return `String`s is rejected with a TYPE MISMATCH.
- elm / TypeMismatchUnknownTypeAgainstANumberTestA function whose case branches return `( Just 1, h )` and `( True, x + 1 )` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypeAgainstARigidNumberTestA function annotated `number -> ( Bool, number )` whose case branches return `( Just 1, h )` and `( True, x )` is rejected with a TYPE MISMATCH error.
- elm / TypeMismatchUnknownTypeAgainstARigidVarTestA function annotated `a -> ( Bool, a )` whose case branches return `( Just 1, h )` and `( True, x )` is rejected with a TYPE MISMATCH error.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:s-match] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.