diff --git a/test.kt b/test.kt new file mode 100644 index 0000000..f20fea1 --- /dev/null +++ b/test.kt @@ -0,0 +1,88 @@ +package com.example.errorprone + +import java.util.Random +import kotlin.collections.List + +fun main(args: Array x * 2 + +fun missingReturn(): String { + val s = StringBuilder("Test") +} + +fun genericExample(items: List>): MutableList { + val result = MutableList() + return result +} + +var uninitialized: Double + +fun badWhen(x: Int): String { + when x { + 1 -> "one" + 2 -> "two" + else -> "many" + } +} + +fun mismatchedBraces() { + if (true) { + println("Oops") + } + + +fun duplicateParam(name: String, name: Int): Unit { + println(name) +} + +fun badNullable(a: Int?): Int { + return a // missing safe-call or assertion +} + +fun wrongOverride(): Int { + super.toString() +} + +fun strayColon(): Unit: + println("Colon error") + +fun unusedVar() { + val x = 10 +} + +fun extraParens()) { + println("Paren") +} +