Florian Wiesner
03/07/2018, 4:29 PMaraqnid
03/07/2018, 4:51 PMdroidrcc
03/07/2018, 5:17 PMwhile ((len = def.deflate(buf, 0, buf.size)) > 0) {}
?kevinmost
03/07/2018, 6:25 PMwhile (true)
with a break
over crazy assignments in the while
condition:
var len: Int = 0
while (true) {
len = def.deflate(buf, 0, buf.size)
if (len <= 0) break
...
}
warriorprincess
03/07/2018, 7:20 PMdigitalsanctum
03/07/2018, 7:43 PMdumptruckman
03/08/2018, 2:04 AMdumptruckman
03/08/2018, 2:21 AMlovis
03/08/2018, 6:51 AMflatten
to smoosh
?chan
03/08/2018, 9:11 AMinline fun <reified T : Enum<T>> List<String>.toEnums(): List<T> {
return this.map {
enumValueOf<T>(it)
}
}
karelpeeters
03/08/2018, 9:15 AMinline fun <reified T : Enum<T>> List<String>.toEnums() = map { enumValueOf<T>(it) }
Leonid
03/08/2018, 9:20 AMalex
03/08/2018, 1:00 PMm
03/08/2018, 5:12 PMDevon Humes
03/08/2018, 8:58 PMsealed class Parent {
class Child : Parent()
}
interface Factory<T : Parent>
class FactoryBuilder {
fun <T : Parent> build(item: T): Factory<T> {
return when(item) {
is Parent.Child -> {
object : Factory<Parent.Child> {
}
}
}
}
}
kristofdho
03/09/2018, 12:16 AMdumptruckman
03/09/2018, 3:09 AMError:(6, 47) java: cannot access xyz.jeremydwood.school.compiler.grammar.GrammarResult
bad class file: D:\Users\Jeremy\Projects\tiny-compiler\out\production\classes\xyz\jeremydwood\school\compiler\grammar\GrammarResult.class
class file contains malformed variable arity method: GrammarResult(xyz.jeremydwood.school.compiler.grammar.GrammarError,xyz.jeremydwood.school.compiler.grammar.GrammarResult[],kotlin.jvm.internal.DefaultConstructorMarker)
Please remove or make sure it appears in the correct subdirectory of the classpath.
Rich Gabrielli
03/09/2018, 1:16 PMAndreas Sinz
03/09/2018, 3:01 PMchristopher
03/09/2018, 3:32 PMclass Bar<T> protected constructor(type: Class<T>) {
companion object {
inline operator fun <reified T> invoke(): Bar<T> {
return Bar(T::class.java)
}
}
}
val bar = Bar<String>()
Ruckus
03/09/2018, 4:19 PMCzar
03/09/2018, 4:39 PM<Something>Utils
elect
03/09/2018, 7:26 PMvar
with custom get and set methods because they are in an interface.. isn't there any other way?Andreas Sinz
03/10/2018, 4:32 PMdata class Foo private constructor (val a: Int, val b: Int)
fun Foo(a: Int, b: Int) = ...
karelpeeters
03/10/2018, 6:52 PMKulwinder Singh
03/11/2018, 3:43 AMbetterclever
03/11/2018, 8:57 AMgalex
03/11/2018, 11:10 AMrobstoll
03/11/2018, 12:30 PMobject CoreFactory : ICoreFactory by factory {
private val factory: ICoreFactory
init {
val loader = ServiceLoader.load(ICoreFactory::class.java)
val itr = loader.iterator()
check(itr.hasNext()) {
"Could not find an implementation for ${ICoreFactory::class.java.name}"
}
factory = itr.next()
}
}
sudhanshu singh
03/11/2018, 12:59 PMsudhanshu singh
03/11/2018, 12:59 PMCzar
03/11/2018, 1:05 PMsudhanshu singh
03/11/2018, 1:08 PMCzar
03/11/2018, 1:09 PMKonstantin
03/11/2018, 1:10 PMCzar
03/11/2018, 1:11 PMval type: MenuTypeModel
serializer will try to instantiate the parent instead of MAP
, CALENDAR
or LEADERBOARD
which you probably want.sudhanshu singh
03/11/2018, 1:12 PMCzar
03/11/2018, 1:14 PMsudhanshu singh
03/11/2018, 1:15 PMCzar
03/11/2018, 1:18 PMgildor
03/11/2018, 2:16 PM