|
Apparently, even though the compiler has safeguards against infinite type
printouts, having a depth counter, we didn’t account for the cases when
printouts are both self-referential and self-multiplying.
For one, SI-8158 provides an example of such a type, which is a structural
type that refers to itself twice in return types of its methods. At first,
printing such a type would go deeper and deeper, but then it will hit
the depth limit and start multiply indefinitely.
This commit fixes this particular problem by recognizing self-references
as this.type’s and printing them out as such. The subsequent commit will
introduce a more general facility.
|