This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HogeKt.java | |
import kotlin.Metadata; | |
import kotlin.jvm.internal.Intrinsics; | |
import org.jetbrains.annotations.NotNull; | |
@Metadata( | |
mv = {1, 1, 2}, | |
bv = {1, 0, 1}, | |
k = 2, | |
d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u000e\n\u0002\b\u0002\u001a\u0019\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005¨\u0006\u0006"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A() { | |
private val str: String | |
init { | |
str = "aaa" | |
val s: String = getStr() | |
println("${s.length}") // java.lang.NullPointerException | |
} | |
fun getStr(): String { | |
return str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun hoge() { | |
val callback = {} いくぜ {} | |
} | |
infix fun (() -> Unit).いくぜ(f: () -> Unit) : Runnable = Runnable {f()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun highOrderOne(one : Int, f : ((one : Int) -> Int)) { | |
} | |
fun hoge(){ | |
highOrderOne(1) { x -> | |
x + 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val f : (() -> Unit)? = null | |
f() // コンパイル通る | |
} | |
operator fun <R> Function0<R>?.invoke() = this?.invoke() | |
operator fun <P1,R> Function1<P1,R>?.invoke() : R? = this?.invoke() | |
operator fun <P1, P2, R> Function2<P1, P2, R>?.invoke() : R? = this?.invoke() | |
operator fun <P1, P2, P3, R> Function3<P1, P2, P3, R>?.invoke() : R? = this?.invoke() | |
operator fun <P1, P2, P3, P4, R> Function4<P1, P2, P3, P4, R>?.invoke() : R? = this?.invoke() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.jayway.jsonassert.JsonAssert | |
import com.jayway.jsonassert.JsonAsserter | |
import org.hamcrest.Matcher | |
import kotlin.test.* | |
class LibraryTest { | |
@Test fun testHogeJson() { | |
val jsonString = """ | |
{ | |
"foo": "aaa", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include QMK_KEYBOARD_H | |
extern keymap_config_t keymap_config; | |
#define _BASE 0 | |
#define _META 1 | |
#define _SYMB 2 | |
#define _RAISE 3 | |
#define _RGB 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include QMK_KEYBOARD_H | |
#include "bootloader.h" | |
#ifdef PROTOCOL_LUFA | |
#include "lufa.h" | |
#include "split_util.h" | |
#endif | |
#ifdef AUDIO_ENABLE | |
#include "audio.h" | |
#endif | |
#ifdef SSD1306OLED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vim.incsearch": true, | |
"vim.useSystemClipboard": true, | |
"vim.useCtrlKeys": true, | |
"vim.hlsearch": true, | |
"vim.highlightedyank.enable" :true, | |
"vim.highlightedyank.color": "rgba(241, 238, 29, 0.5)", | |
"vim.normalModeKeyBindingsNonRecursive": [ | |
{ | |
"before": ["<leader>", "v", "s", "p"], |