nimlings icon indicating copy to clipboard operation
nimlings copied to clipboard

Possible type in Exercise 2

Open bbuck opened this issue 3 years ago • 0 comments

In Exercise 02, in the last section the comments say (emphasis mine):

This probably won't compile because it cannot evaluate totalArea at compile time. Maybe we can change the variable type of totalCost to something that evaluates at compile time. Hint: var evaluates at runtime.

It's confusing, I think the second compile should be runtime, since it won't evaluate at compile time, it can't be changed to something will evaluate at compile time and the hint makes no sense if it's supposed to be done at compile time.

This is entirely based off the fact that totalArea doesn't need to be compile time becuase technically speaking they all can probably shifted over to const (confirmed they can) and then they all are compile time constants.

bbuck avatar May 16 '21 19:05 bbuck