class Process

Overview

Patch for Process with regards to "lazily" defined instance and class variables. It's very likely the Process class will be mocked. These variables are defined via ||=, making them nillable. The method returns this expression as a value, which it cannot determine the type of. It causes the following error:

In /usr/share/crystal/src/process.cr:374:5

 374 | @channel ||= Channel(Exception?).new
 ^-------
Error: can't infer the type of instance variable '@channel' of Process

This patch explicitly specifies the type of the variables.

Defined in:

mocks/patches.cr