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
300
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
2.2k
About HealthKit nutrition
coe
0
350
iOSDC 2023 Web in tvOS and watchOS
coe
1
560
iOSDC 2023 Push To Talk
coe
1
1.7k
iOSDC手で触れずにアプリを動かす技術
coe
1
1.5k
iOSDC令和時代のXML処理を考える
coe
3
2.2k
iOSDC 2021 Restore
coe
6
1.9k
詳解Storyboard
coe
7
3.5k
あなたの知らない連絡先の世界
coe
15
8.1k
Other Decks in Technology
See All in Technology
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1k
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
2
2.2k
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
生成AIのガバナンスの全体像と現実解
fnifni
1
180
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
1
110
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
110
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
Featured
See All Featured
How GitHub (no longer) Works
holman
311
140k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
The Cult of Friendly URLs
andyhume
78
6.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Code Reviewing Like a Champion
maltzj
520
39k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.3k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
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