Crystal: Don't display internal names in error messages

Created on 18 May 2016  路  3Comments  路  Source: crystal-lang/crystal

Found at least one: https://carc.in/#/r/ysy

def foo(a internal)
  1
end

p foo(b: 1)
Error in line 5: missing argument: a
Overloads are:
 - foo(a internal)

Expected

Error in line 5: missing argument: a
Overloads are:
 - foo(a)

The internal name should be meaningless to the caller and thus just noise in error messages.

draft compiler

Most helpful comment

Ummm... actually, I'm not sure about this. The internal name can make it easier to understand what the argument is supposed to mean. For example, increment(by value) vs. increment(by). I'll leave it like this for now (and put an RFC instead of bug label on this).

All 3 comments

Thanks! I'll include a fix for this in the upcoming 0.17.1, which will have a bunch of other fixes

Ummm... actually, I'm not sure about this. The internal name can make it easier to understand what the argument is supposed to mean. For example, increment(by value) vs. increment(by). I'll leave it like this for now (and put an RFC instead of bug label on this).

Closing this, as internal names have a meaning to a caller (for example def delegate(methods, to object) instead of def delegate(methods, to), the first reads better).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oprypin picture oprypin  路  3Comments

Papierkorb picture Papierkorb  路  3Comments

relonger picture relonger  路  3Comments

asterite picture asterite  路  3Comments

nabeelomer picture nabeelomer  路  3Comments