segmentio / analytics-kotlin

The hassle-free way to add Segment analytics to your Kotlin app (Android/JVM).
MIT License
46 stars 27 forks source link

Set defaultSettings config option to a var #217

Closed niallzato closed 7 months ago

niallzato commented 7 months ago

Despite being a config option when initializing an analytics instance, defaultSettings cannot be assigned due to it being a val. As per Kotlin’s docs: https://developer.android.com/kotlin/learn#:~:text=Kotlin%20uses%20two%20different%20keywords,variable%20whose%20value%20can%20change.

Kotlin uses two different keywords to declare variables: val and var.

Use val for a variable whose value never changes. You can't reassign a value to a variable that was declared using val.

Use var for a variable whose value can change.

image

didiergarcia commented 7 months ago

LGTM