Open mratsim opened 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.
var a = newBoardState(GoInt 19) # Triggers crash <------------------------------
This doesn't trigger crash anymore.
echo amaf_color_map # Triggers crash <------------------------------
This doesn't crash, but it produces:
Error: type mismatch: got <array[0..440, Intersection]>
but expected one of:
proc echo(x: varargs[typed, `$`])
first type mismatch at position: 1
required type for x: varargs[typed]
but expression 'amaf_color_map' is of type: array[0..440, Intersection]
The compiler, I think rightfully, can't infer the N
in Board[N]
when an arbitrary array type is given. With #24098, this stops the $
overload with Board[N]
from matching, and uses the $
overload for arrays instead. Would this be considered correct?
Giving amaf_color_map
the type Board[N]
does make it use the Board[N]
overload, which is an interesting test IMO because an alternative implementation of the language arguably wouldn't support it.
Sorry for the long repro code, it's quite tricky to extract it from my codebase and keep the issue reproducible as 3 differents procs/statements need to be present
This is a follow-up on my Go playing bot project which triggered many bugs last April every time I tried to avoid one:
7609 (Static + type conversion in type section for ranges)
7611 (Static[non-int] +
$
string conversion not matching)7632 (
strformat
doesn't work properly inside generics and templates)With this new example I get: