Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Nim crashes with SIGABRT after getting into a replaceTypeVars infinite loop. #10884
The code below has a
func pad( data: string, len: int ): string = result = data while result.len < len: result = char(0) & result proc test( a: int | uint, b: string = "".pad(64).pad(128) ) = discard test(1)
On Nim stable, and Nim devel, this will cause a silent crash. On a Nim devel debug compiler, it prints the following:
The expected behavior is this compiles without crashing (or if I did violate the language spec, I get an error).
There are four ways to get this code to compile without changing the compiler: