Play

Check-in [30f96733db]
Login
Overview
Comment:Add error message for inexhaustive multiwords.
Timelines: family | ancestors | descendants | both | exhaustiveness-checking
Files: files | file ages | folders
SHA3-256: 30f96733dbacb185c5c3c0f6159fdae1e5084f7780512d702b69bbb063be625e
User & Date: robin.hansen on 2020-10-23 04:44:37
Other Links: branch diff | manifest | tags
Context
2020-10-23
04:46
TypeChecker now checks to see if a multiword handles every possible leading type. Fixes [56a0fe1350]... check-in: dbcb88d2fc user: robin.hansen tags: trunk
04:44
Add error message for inexhaustive multiwords. Closed-Leaf check-in: 30f96733db user: robin.hansen tags: exhaustiveness-checking
04:34
Add more tests to verify correctness of inexhaustiveness check. check-in: 9b6ee57feb user: robin.hansen tags: exhaustiveness-checking
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Play/TypeChecker/Problem.elm from [92339c826a] to [b183d4af4c].

59
60
61
62
63
64
65
66








            SourceLocation.extractFromString source range
                ++ "\n\n"
                ++ "We require a type annotation for '"
                ++ name
                ++ "' as we're unable to infer the type of a recursive call."

        InexhaustiveMultiWord range missingTypes ->
            "TODO"















<
>
>
>
>
>
>
>
>
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
            SourceLocation.extractFromString source range
                ++ "\n\n"
                ++ "We require a type annotation for '"
                ++ name
                ++ "' as we're unable to infer the type of a recursive call."

        InexhaustiveMultiWord range missingTypes ->

            let
                formatTypePattern tp =
                    String.join " -> " (List.map Type.toDisplayString tp)
            in
            SourceLocation.extractFromString source range
                ++ "\n\n"
                ++ "This multiword doesn't handle all potential patterns. Missing patterns for:\n\n"
                ++ String.join "\n" (List.map formatTypePattern missingTypes)