Constant Type Limitations
However, you are going to find that not everything qualifies to be a constant:
- It has to be a primitive type (e.g.,
Boolean
,Int
,Long
,Float
) or aString
- It has to be either a top-level declaration or be declared in an
object
(including acompanion object
) - You cannot override the getter
- You cannot use property delegates
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.