Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin 1.5 preview
Search
Panini
February 17, 2021
Programming
1
380
Kotlin 1.5 preview
Panini
February 17, 2021
Tweet
Share
More Decks by Panini
See All by Panini
Java谷園から逃げ出した話
panini
0
300
Kotlin 1.4-rc
panini
0
180
Fixing Broken Robots - Android Mutation Testing
panini
0
130
Kotlin Multiplatform
panini
2
520
build.gradle.kts
panini
2
2.1k
Kotlin Multi-platform(?)
panini
1
660
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
970
Introducing Android P
panini
2
750
Display Cutout
panini
1
500
Other Decks in Programming
See All in Programming
Java 22 Overview
kishida
1
180
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
260
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
Git Rebase
bkuhlmann
11
1.6k
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
290
Goのmultiple errorsについて (2024年4月版)
syumai
3
550
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
Snowflakeで眠ったデータを起こそう!
estie
0
110
Random\Randomizer クラスで日常のあれこれを解決しよう! / Random\Randomizer class solves familiar trouble
cocoeyes02
0
200
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
640
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.1k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
272
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
RailsConf 2023
tenderlove
3
540
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Facilitating Awesome Meetings
lara
42
5.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
KATA
mclloyd
15
12k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
20
1.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
125
32k
Transcript
Kotlin 1.5 preview Kotlin愛好会 vol.27
About Me • Matthew Vern / Panini • Twitter: @panini_ja
Github: panpanini • Mercari, Inc • Android Engineer (US) • Kotlin可愛い
Summary • Sealed Class improvements • Sealed Interface • Reference:
https://zsmb.co/sealed-goodies-coming-in-kotlin-1-5/
Sealed Class improvements
Kotlin ~1.4 Sealed Class • https://kotlinlang.org/docs/sealed-classes.html • Enum with super
power • Can be defined either nested, or in the same file • https://qiita.com/kikuchy/items/ad89a12029082be8d218
Kotlin ~1.4 Sealed Class
Kotlin ~1.4 Sealed Class
Kotlin ~1.4 Sealed Class
Kotlin 1.5+ Sealed Class • https://kotlinlang.org/docs/sealed-classes.html • Can be defined
anywhere in the same package, and same module
Sealed Interface
Kotlin 1.5+ Sealed Interface • https://kotlinlang.org/docs/sealed-classes.html#sealed-interfaces • Implementations must be
declared in same package and same module • Can restrict implementers to inside a single module ◦ Useful for hiding implementation details • YouTrack: https://youtrack.jetbrains.com/issue/KT-22286
Summary • Sealed Class is like super enum • Sealed
Interface is like package private Interface • Kotlin 1.5 looks good!
Have a nice Kotlin!