~/talk

Contracts in Kotlin

TalkinRussianat JetBrains Open Day 2019 · on Friday, 2019-06-28· [kotlin]
links:none on file
slides:none on file

Kotlin introduces explicit contracts so the compiler can rely on a function’s behavior instead of expensive interprocedural analysis. Contracts express logical implications (for example: if a function returns true then an argument is a String) and invocation counts (notably exactly-once invocation) to enable safe smartcasts and initialization inside lambdas. The team implemented a prototype in a compiler fork, exposed experimental syntax in Kotlin 1.3 for standard-library helpers, and notes there is no verification yet and many open issues remain (runtime checks, Java interop, inheritance, verbosity).

AI-written summary · about

  1. 0:00Start
  2. 0:49Motivating example
  3. 16:17Open questions
  4. 19:11Use-case #1. Thread affinity
  5. 23:29Use-case #2. Safe builders
  6. 31:51Current state
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.