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 message usability suggestion #28

Open
raould opened this issue Jan 29, 2015 · 0 comments
Open

Error message usability suggestion #28

raould opened this issue Jan 29, 2015 · 0 comments

Comments

@raould
Copy link

raould commented Jan 29, 2015

  local points:{{number}} =
     {{1,2},
      {3,4}}
  local lines = {}
  for i = 1, #points-1 do
     local pt1:{number} = points[i]

player.tl:6:10: type error, attempt to assign '({number:(number | nil)} | nil)' to '{number:(number | nil)}'

To me that is ambiguous, please
(a) make it so that the message shows the types in the same order they appear in the sources. So for a bad x=y then the error should say something like, "attempt to assign [type of x] from [type of y]"
(b) please also if possible show the exact string of source code that was typed. So for a bad x=y then the error should say something like
[on the first line] "attempt to assign [type of x] from [type of y]"
[on the 2nd line] "'x':[type of x]"
[on the 3rd line] "'y':[type of y]"
(I do not think "attempt to assign x:[type of x] from y:[type of y]" will be good because x and y could be large, and the types are already long, so the final error message would be harder for humans to grok.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants