Skip to content

Instantly share code, notes, and snippets.

@uberto
uberto / delegation.kt
Created May 12, 2018 19:38
Multiple Inheritance via Delegation in Kotlin
package com.gamasoft.delegation
import assertk.assert
import assertk.assertions.isEqualTo
import org.junit.Test
//https://kotlinlang.org/docs/reference/delegation.html
interface Printer {
fun print(msg: String)
@OliverJAsh
OliverJAsh / foo.ts
Last active January 27, 2025 18:24
Records and dictionaries in TypeScript
/*
In JavaScript, objects can be used to serve various purposes.
To maximise our usage of the type system, we should assign different types to our objects depending
on the desired purpose.
In this blog post I will clarify two common purposes for objects known as records and dictionaries
(aka maps), and how they can both be used with regards to the type system.