svenssonjoel / Sense-VM

Sense-VM has changed name to SynchronVM and is available in a new repository https://github.com/SynchronVM/SynchronVM
MIT License
5 stars 1 forks source link

When type is not found `undefined` thrown to the user #20

Open Abhiroop opened 3 years ago

Abhiroop commented 3 years ago

In an example, I had not defined a type called Time and I got the following:

*** Exception: Prelude.undefined
CallStack (from HasCallStack):
  error, called at libraries/base/GHC/Err.hs:80:14 in base:GHC.Err
  undefined, called at /Users/abhiroopsarkar/C/Sense-VM/frontend/CamIoT/src/Typechecker/TypecheckTinyCamiot.hs:54:39 in main:Typechecker.TypecheckTinyCamiot

This is thrown from here: https://github.com/svenssonjoel/Sense-VM/blob/master/frontend/CamIoT/src/Typechecker/TypecheckTinyCamiot.hs#L54

We need to throw more meaningful error messages.