Scala Modifiers and Type parametrization

前端 未结 3 952
日久生厌
日久生厌 2021-02-13 12:35

I\'m creating a memoization class.

Each class memoizes a function type and has the following definition:

 class MemoizedFunction1[-T1, +R](f: T1 => R)         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-13 12:57

    Programming in Scala touches on this topic in Section 19.7 Object private data: "object private members can be accessed only from within the object in which they are defined. It turns out that accesses to variables from the same object in which they are defined do not cause problems with variance."

提交回复
热议问题