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 Dynamic type
Search
coe
September 26, 2023
Technology
0
280
Kotlin Dynamic type
集まれSwift好き!Swift愛好会 vol.77 @ DeNA
2023/09/26
coe
September 26, 2023
Tweet
Share
More Decks by coe
See All by coe
すべてのヘルスケアデータを紐解く.pdf
coe
0
2k
About HealthKit nutrition
coe
0
340
iOSDC 2023 Web in tvOS and watchOS
coe
1
530
iOSDC 2023 Push To Talk
coe
1
1.6k
iOSDC手で触れずにアプリを動かす技術
coe
1
1.4k
iOSDC令和時代のXML処理を考える
coe
3
2.1k
iOSDC 2021 Restore
coe
6
1.8k
詳解Storyboard
coe
7
3.4k
あなたの知らない連絡先の世界
coe
15
8k
Other Decks in Technology
See All in Technology
マネジメント視点でのre:Invent参加 ~もしCEOがre:Inventに行ったら~
kojiasai
0
470
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
480
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
470
CyberAgent 生成AI Deep Dive with Amazon Web Services / genai-aws
cyberagentdevelopers
PRO
1
480
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
340
現地でMeet Upをやる場合の注意点〜反省点を添えて〜
shotashiratori
0
520
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
650
事業者間調整の行間を読む 調整の具体事例
sugiim
0
1.5k
CAMERA-Suite: 広告文生成のための評価スイート / ai-camera-suite
cyberagentdevelopers
PRO
3
270
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
新卒1年目が向き合う生成AI事業の開発を加速させる技術選定 / ai-web-launcher
cyberagentdevelopers
PRO
7
1.5k
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Being A Developer After 40
akosma
86
590k
Docker and Python
trallard
40
3.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Designing Experiences People Love
moore
138
23k
Code Reviewing Like a Champion
maltzj
519
39k
The Invisible Side of Design
smashingmag
297
50k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
Agile that works and the tools we love
rasmusluckow
327
21k
GitHub's CSS Performance
jonrohan
1030
460k
How STYLIGHT went responsive
nonsquared
95
5.2k
Transcript
ڧ݄ %ZOBNJDUZQF ू·Ε4XJGU͖ʂ4XJGUѪձWPM ू·Ε,PUMJO͖ʂ,PUMJOѪձWPM!%F/"
w ڧ w J04ΤϯδχΞ
%ZOBNJDUZQF
w ڧ w J04Τ ϯδχ Ξ
%ZOBNJD UZQF
fun dynamicFun(x: dynamic): Unit { val dyn: dynamic = ...
} ,PUMJO%ZOBNJDUZQF
%ZOBNJDUZQF
%ZOBNJDUZQF w EZOBNJDܕ w WBMEZOEZOBNJDʜ w ͳΜͰೖΔ
fun dynamicFun(x: dynamic): Unit { }
fun dynamicFun(x: dynamic): Unit { } fun anyFun(x: Any): Unit
{ }
fun dynamicFun(x: dynamic): Unit { x.god } fun anyFun(x: Any):
Unit { x.god // ←ίϯύΠϧΤϥʔ }
%ZOBNJDUZQF w EZOBNJDܕ w WBMEZOEZOBNJDʜ w ͳΜͰೖΔ w ܕνΣοΫΛߦΘͳ͍ʢίϯύΠϧΤϥʔʹͳΒͳ͍ʣ
// xHuman fun dynamicFun(x: dynamic): Unit { x.back.left.left.up.scratch() } class
Back { val left: Back get() = Back() val right: Back get() = Back() val up: Back get() = Back() val down: Back get() = Back() fun scratch(): Unit { println(“ຬʂ”) } } class Human { val back = Back() }
%ZOBNJDUZQF w EZOBNJDܕ w WBMEZOEZOBNJDʜ w ͳΜͰೖΔ w ܕνΣοΫΛߦΘͳ͍ʢίϯύΠϧΤϥʔʹͳΒͳ͍ʣ w
ࣗ༝ʹϓϩύςΟؔΛݺΔ w EZOBNJDܕͷϓϩύςΟؔͷϦλʔϯEZOBNJDܕ
fun dynamicPlus(x: dynamic, y: dynamic): Unit { x + y
}
fun dynamicPlus(x: dynamic, y: dynamic): Unit { x + y
// 3 } dynamicPlus(1, 2)
fun dynamicPlus(x: dynamic, y: dynamic): Unit { x + y
// ڧ } dynamicPlus(“”, “ڧ”)
fun dynamicPlus(x: dynamic, y: dynamic): Unit { x + y
// iOSΤϯδχΞ } dynamicPlus(“iOS”, “ΤϯδχΞ”)
fun dynamicPlus(x: dynamic, y: dynamic): Unit { x + y
// 105ΤϯδχΞ } dynamicPlus(105, “ΤϯδχΞ”)
%ZOBNJDUZQF w EZOBNJDܕ w WBMEZOEZOBNJDʜ w ͳΜͰೖΔ w ܕνΣοΫߦΘͳ͍ʢίϯύΠϧΤϥʔʹͳΒͳ͍ʣ w
ࣗ༝ʹϓϩύςΟؔΛݺΔ w EZOBNJDܕͷϓϩύςΟEZOBNJDܕ w EZOBNJDಉ࢜ͷܭࢉՄೳ
͍͢͝ʂ
͡ΊΑ͏
,PUMJO+4
IUUQTLPUMJOMBOHPSHEPDTEZOBNJDUZQFIUNM %ZOBNJDUZQF
None