You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we know a arg type is nilable with only one type, e.g. String | Nil, can we replace it with String? ?
We don't need add the parentheses for union type? e.g. instead of (String | Int32), we can replace it with: String | Int32.
If user don't know how to use this tool, so, run just ./typer alone is possible.
This give a error message like this:
╰──➤ $ bin/typer
Unhandled exception: Index out of bounds (IndexError)
from /home/zw963/Crystal/share/crystal/src/array.cr:1512:13 in 'shift'
from lib/source-typer/src/cli_options.cr:56:19 in 'parse'
from lib/source-typer/src/cli.cr:5:1 in '__crystal_main'
from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:118:5 in 'main_user_code'
from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:104:7 in 'main'
from /home/zw963/Crystal/share/crystal/src/crystal/main.cr:130:3 in 'main'
from /usr/lib/libc.so.6 in '??'
from /usr/lib/libc.so.6 in '__libc_start_main'
from bin/typer in '_start'
from ???
We can print the help message instead this exception.
If you prefer those improve, i can try make a PR for several of them.
Thanks.
The text was updated successfully, but these errors were encountered:
Aha! Yeah, great suggestions! I've actually incorporated both the first and second bullets into my port into the crystal compiler itself 😅 The third point is still a bug that I missed, whoops.
If the crystal team doesn't accept the new tool, then I'll backport those changes into here. We'll see. I'll keep this issue open until that gets decided.
If we know a arg type is nilable with only one type, e.g.
String | Nil
, can we replace it withString?
?We don't need add the parentheses for union type? e.g. instead of
(String | Int32)
, we can replace it with:String | Int32
.If user don't know how to use this tool, so, run just
./typer
alone is possible.This give a error message like this:
We can print the help message instead this exception.
If you prefer those improve, i can try make a PR for several of them.
Thanks.
The text was updated successfully, but these errors were encountered: