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
390
Kotlin 1.5 preview
Panini
February 17, 2021
Tweet
Share
More Decks by Panini
See All by Panini
Java谷園から逃げ出した話
panini
0
340
Kotlin 1.4-rc
panini
0
200
Fixing Broken Robots - Android Mutation Testing
panini
0
150
Kotlin Multiplatform
panini
2
590
build.gradle.kts
panini
2
2.3k
Kotlin Multi-platform(?)
panini
1
690
Convert Java file to Kotlin file ⌥⇧⌘K
panini
0
1k
Introducing Android P
panini
2
770
Display Cutout
panini
1
550
Other Decks in Programming
See All in Programming
[PyCon Korea 2024 Keynote] 커뮤니티와 파이썬, 그리고 우리
beomi
0
120
EventSourcingの理想と現実
wenas
6
2.3k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
830
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
510
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
CSC509 Lecture 09
javiergs
PRO
0
140
Amazon Qを使ってIaCを触ろう!
maruto
0
390
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
160
Featured
See All Featured
RailsConf 2023
tenderlove
29
900
We Have a Design System, Now What?
morganepeng
50
7.2k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
110
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Building Your Own Lightsaber
phodgson
103
6.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Being A Developer After 40
akosma
86
590k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
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!