Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages from make -f are more concise and readable than from make #1099

Open
edwardpeters opened this issue Sep 7, 2023 · 0 comments
Labels
task Task level project item

Comments

@edwardpeters
Copy link

edwardpeters commented Sep 7, 2023

Describe the bug
Type errors coming from the incremental compiler are much more verbose and unclear than those coming from the non-incremental compiler.

To Reproduce
Steps to reproduce the behavior:

Starting from following code snippet with a type error:

module Scratch.ExampleModule exposing (..)

typeErrorTest : Bool -> String
typeErrorTest x = True

Compiled with morphir-elm make -f , this produces a fairly nice error:

Error: [
  [
    "errors_in_source_file",
    "ExampleModule",
    [
      {
        "errorMessage": "Type error in value 'typeErrorTest': Could not unify 'Morphir.SDK:String:string' with 'Morphir.SDK:Basics:bool' because the references do not match",
        "sourceLocations": []
      }
    ]
  ]
]

Whereas comping with morphir-elm make, you get:

Error: [
  [
    "RepoError",
    "Cannot process value",
    [
      [
        "TypeCheckError",
        [
          [
            "example",
            "module"
          ]
        ],
        [
          "type",
          "error",
          "test"
        ],
        [
          "UnifyError",
          [
            "CouldNotUnify",
            "RefMismatch",
            [
              "meta_ref",
              [
                [
                  [
                    "morphir"
                  ],
                  [
                    "s",
                    "d",
                    "k"
                  ]
                ],
                [
                  [
                    "string"
                  ]
                ],
                [
                  "string"
                ]
              ],
              [],
              null
            ],
            [
              "meta_ref",
              [
                [
                  [
                    "morphir"
                  ],
                  [
                    "s",
                    "d",
                    "k"
                  ]
                ],
                [
                  [
                    "basics"
                  ]
                ],
                [
                  "bool"
                ]
              ],
              [],
              null
            ]
          ]
        ]
      ]
    ]
  ]
]

Expected behavior
A more concise (/readable, /pretty-printed) error should be given in both instances.

Desktop (please complete the following information):

  • OS: [e.g. iOS] OSX
  • Browser: Unused
  • Version 2.89.0
@edwardpeters edwardpeters added the task Task level project item label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Task level project item
Projects
None yet
Development

No branches or pull requests

1 participant