Change short_reference
for top-level methods to ::foo
#13957
Labels
good first issue
This is an issue suited for newcomers to become aquianted with working on the codebase.
help wanted
This issue is generally accepted and needs someone to pick it up
status:discussion
topic:compiler
I'm proposing to change the notation for
Def#short_reference
andMacro#short-reference
for the top-level scope fromtop-level foo
to::foo
.The
short_reference
format isType#def
/Type.def
for most defs and methods. Only for those in the top-level scope the format istop-level foo
.I think the more commonly used notation is actually
::foo
with double colon indicating the top-level scope. This is more succinct and unambiguous. It fits better to the other notations in being syntactical instead of a textual description.As far as I can tell,
short_reference
is currently used in three locations. The expected effects of this change would be as follows:method
would be an improvement in either case)Warning: Deprecated top-level foo. Do not use me
Warning: Deprecated ::foo. Do not use me
method top-level foo must return Int32 but it is returning Char
method ::foo must return Int32 but it is returning Char
unreachable
:foobar.cr:1:1 top-level foo 3 lines
foobar.cr:1:1 ::foo 3 lines
The text was updated successfully, but these errors were encountered: