builttoroam / device_calendar

A cross platform plugin for modifying calendars on the user's device
https://pub.dev/packages/device_calendar
BSD 3-Clause "New" or "Revised" License
267 stars 267 forks source link

Added 'else' in compliance with Kotlin 1.7.21. #472

Closed sgowda97 closed 1 year ago

sgowda97 commented 1 year ago

Issue #470

Error

CalendarDelegate.kt:784:9 'when' expression must be exhaustive, add necessary 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY' branches or 'else' branch instead

Fix

when (rfcRecurrenceRule.freq) { Freq.WEEKLY, Freq.MONTHLY, Freq.YEARLY -> { recurrenceRule.daysOfWeek = rfcRecurrenceRule.byDayPart?.mapNotNull { DayOfWeek.values().find { dayOfWeek -> dayOfWeek.ordinal == it.weekday.ordinal } }?.toMutableList() } else -> recurrenceRule.daysOfWeek = null }

Added 'else' so that it is compliant with Kotlin 1.7.21.

IVLIVS-III commented 1 year ago

@thomassth version 4.3.1 should be ready to be approved and merged, I just fixed a failing test, bumped the version and updated the changelog.