-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix nimsuggest crash with arrow type sugar (#24185)
fixes #24179 The original fix made it so calls to `skError`/`skUnknown` (in this case `->`, for some reason `sugar` couldn't be imported) returned an error node, however this breaks tsug_accquote for some reason I don't understand (it even parses as `tsug_accquote.discard`) so I've just added a guard based on the stacktrace.
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# issue #24179 | ||
|
||
import sugar | ||
|
||
type | ||
Parser[T] = object | ||
|
||
proc eatWhile[T](p: Parser[T], predicate: T -> bool): seq[T] = | ||
return @[] | ||
|
||
proc skipWs(p: Parser[char]) = | ||
discard p.eatWhile((c: char) => c == 'a') | ||
#[!]# | ||
|
||
discard """ | ||
$nimsuggest --tester $file | ||
>chk $1 | ||
chk;;skUnknown;;;;Hint;;???;;0;;-1;;">> (toplevel): import(dirty): tests/tarrowcrash.nim [Processing]";;0 | ||
chk;;skUnknown;;;;Hint;;$file;;11;;5;;"\'skipWs\' is declared but not used [XDeclaredButNotUsed]";;0 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters