Stabel

Check-in [08ceb30476]
Login
Overview
Comment:Fix tests.
Timelines: family | ancestors | descendants | both | module-definition
Files: files | file ages | folders
SHA3-256: 08ceb30476c923c89fd32bec94acc92204734009f8c4d069d9e8acb9a2bdb482
User & Date: robin.hansen on 2021-05-19 12:56:05
Other Links: branch diff | manifest | tags
Context
2021-05-20
16:23
Parser now understands internal and external references in type signature. check-in: 4a96b863d6 user: robin.hansen tags: module-definition
2021-05-19
12:56
Fix tests. check-in: 08ceb30476 user: robin.hansen tags: module-definition
12:49
Fix compile errors in Test/Parser check-in: f0ada70643 user: robin.hansen tags: module-definition
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Play/Qualifier.elm from [2060841194] to [680c118eed].

220
221
222
223
224
225
226



227
228
229
230
231
232
233
qualifyMemberType :
    RunConfig
    -> SourceLocationRange
    -> Parser.PossiblyQualifiedType
    -> Result Problem Type
qualifyMemberType config range type_ =
    case type_ of



        Parser.LocalRef name [] ->
            case Dict.get name config.ast.types of
                Just _ ->
                    Ok <| Type.Custom (qualifyName config name)

                Nothing ->
                    Err <| UnknownTypeRef range name







>
>
>







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
qualifyMemberType :
    RunConfig
    -> SourceLocationRange
    -> Parser.PossiblyQualifiedType
    -> Result Problem Type
qualifyMemberType config range type_ =
    case type_ of
        Parser.LocalRef "Int" [] ->
            Ok <| Type.Int

        Parser.LocalRef name [] ->
            case Dict.get name config.ast.types of
                Just _ ->
                    Ok <| Type.Custom (qualifyName config name)

                Nothing ->
                    Err <| UnknownTypeRef range name

Modified tests/Test/Parser.elm from [df6f49f423] to [3e33dc568d].

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
...
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
                    expectedAst =
                        { moduleDefinition = AST.emptyModuleDefinition
                        , types = Dict.empty
                        , words =
                            Dict.fromListBy .name
                                [ { name = "over"
                                  , typeSignature =
                                        Verified
                                            { input = [ Generic "a", Generic "b" ]
                                            , output = [ Generic "a", Generic "b", Generic "a" ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
................................................................................
                                    []
                                    []
                                ]
                        , words =
                            Dict.fromListBy .name
                                [ { name = "True"
                                  , typeSignature =
                                        UserProvided
                                            { input = []
                                            , output = [ LocalRef "True" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "True" ]
                                  }
                                , { name = "False"
                                  , typeSignature =
                                        UserProvided
                                            { input = []
                                            , output = [ LocalRef "False" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "False" ]







|







 







|










|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
...
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
                    expectedAst =
                        { moduleDefinition = AST.emptyModuleDefinition
                        , types = Dict.empty
                        , words =
                            Dict.fromListBy .name
                                [ { name = "over"
                                  , typeSignature =
                                        UserProvided
                                            { input = [ Generic "a", Generic "b" ]
                                            , output = [ Generic "a", Generic "b", Generic "a" ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
................................................................................
                                    []
                                    []
                                ]
                        , words =
                            Dict.fromListBy .name
                                [ { name = "True"
                                  , typeSignature =
                                        Verified
                                            { input = []
                                            , output = [ LocalRef "True" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "True" ]
                                  }
                                , { name = "False"
                                  , typeSignature =
                                        Verified
                                            { input = []
                                            , output = [ LocalRef "False" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "False" ]

Modified tests/Test/Qualifier.elm from [78d12ccc11] to [e4846377b4].

282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
...
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
...
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
                                                    [ Type.Int ]
                                      , implementation =
                                            SoloImpl
                                                [ Builtin emptyRange Builtin.Apply
                                                ]
                                      }
                                    , { name = "main"
                                      , metadata =
                                            Metadata.default
                                                |> Metadata.asEntryPoint
                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:main/2"
                                                , Word emptyRange "apply-to-num"
                                                , WordRef emptyRange "quote:main/1"
                                                , Word emptyRange "apply-to-num"
................................................................................
                            }

                        expectedAst =
                            { types = Dict.empty
                            , words =
                                Dict.fromListBy .name
                                    [ { name = "a"
                                      , metadata =
                                            Metadata.default
                                                |> Metadata.asEntryPoint
                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:a/1"
                                                , Builtin emptyRange Builtin.Apply
                                                ]
                                      }
................................................................................
                            }

                        expectedAst =
                            { types = Dict.empty
                            , words =
                                Dict.fromListBy .name
                                    [ { name = "main"
                                      , metadata =
                                            Metadata.default
                                                |> Metadata.asEntryPoint
                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:main/1"
                                                , Builtin emptyRange Builtin.Apply
                                                ]
                                      }







<
|
<







 







<
|
<







 







<
|
<







282
283
284
285
286
287
288

289

290
291
292
293
294
295
296
...
357
358
359
360
361
362
363

364

365
366
367
368
369
370
371
...
422
423
424
425
426
427
428

429

430
431
432
433
434
435
436
                                                    [ Type.Int ]
                                      , implementation =
                                            SoloImpl
                                                [ Builtin emptyRange Builtin.Apply
                                                ]
                                      }
                                    , { name = "main"

                                      , metadata = Metadata.default

                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:main/2"
                                                , Word emptyRange "apply-to-num"
                                                , WordRef emptyRange "quote:main/1"
                                                , Word emptyRange "apply-to-num"
................................................................................
                            }

                        expectedAst =
                            { types = Dict.empty
                            , words =
                                Dict.fromListBy .name
                                    [ { name = "a"

                                      , metadata = Metadata.default

                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:a/1"
                                                , Builtin emptyRange Builtin.Apply
                                                ]
                                      }
................................................................................
                            }

                        expectedAst =
                            { types = Dict.empty
                            , words =
                                Dict.fromListBy .name
                                    [ { name = "main"

                                      , metadata = Metadata.default

                                      , implementation =
                                            SoloImpl
                                                [ Integer emptyRange 1
                                                , WordRef emptyRange "quote:main/1"
                                                , Builtin emptyRange Builtin.Apply
                                                ]
                                      }