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
package org.jetbrains.research.kotoed.util | |
import org.junit.Test | |
import kotlin.reflect.* | |
import kotlin.reflect.jvm.reflect | |
data class TypeMirror( | |
val classifier: ClassifierMirror?, | |
val arguments: List<TypeProjectionMirror>, | |
val isNullable: Boolean, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>group.id</groupId> | |
<artifactId>artifact-id</artifactId> | |
<version>0.0.1</version> |
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
/** | |
* We declare a package-level function main which returns Unit and takes | |
* an Array of strings as a parameter. Note that semicolons are optional. | |
*/ | |
sealed class Expr | |
enum class BinaryOp{ ADD, MUL, DIV } | |
data class BinaryExpr(val op: BinaryOp, val lhv: Expr, val rhv: Expr): Expr | |
data class Constant(val value: Int): Expr | |
data class Variable(val name: String): Expr |
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
.pacman > div:nth-child(3)::after, .pacman > div:nth-child(4)::after, .pacman > div:nth-child(5)::after { | |
content: ''; | |
position: absolute; | |
border-bottom: 7.0px solid; | |
border-left: 4.0px solid transparent; | |
border-right: 4.0px solid transparent; | |
top: -2px; | |
left: 4px; | |
-webkit-transform: rotate(-140deg); |
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
<distributionManagement> | |
<repository> | |
<id>bintray-vorpal-research-kotlin-maven</id> | |
<name>vorpal-research-kotlin-maven</name> | |
<url>https://api.bintray.com/maven/vorpal-research/kotlin-maven/${artifactId}/;publish=1</url> | |
</repository> | |
</distributionManagement> |
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
package org.jetbrains.research.kotoed | |
open class AbstractStuff() { | |
inline suspend fun<reified T> hello(value: T): T = println("Hello, ${T::class}").let { value } | |
} | |
class Stuff: AbstractStuff() { | |
suspend fun foo() = hello(40) | |
} |
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 org.junit.Test | |
import java.util.ArrayList | |
interface Whatever | |
fun Whatever.crash() = 2 | |
object obj: Whatever | |
fun Any?.ttt(): Any? = | |
when (this) { |
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
Exception in thread "main @coroutine#1" java.lang.ClassCastException: org.jetbrains.research.kotoed.util.Playground$Whatever cannot be cast to java.lang.String | |
at org.jetbrains.research.kotoed.util.Playground$testStuff$1$response$1.<init>(Playground.kt:24) | |
at org.jetbrains.research.kotoed.util.Playground$testStuff$1.doResume(Playground.kt:23) | |
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:50) | |
at kotlinx.coroutines.experimental.DispatchedContinuation.resume(CoroutineDispatcher.kt:152) | |
at kotlin.coroutines.experimental.CoroutinesKt.startCoroutine(CoroutinesLibrary.kt:35) | |
at kotlinx.coroutines.experimental.BuildersKt.launch(Builders.kt:49) | |
at kotlinx.coroutines.experimental.BuildersKt.launch$default(Builders.kt:43) | |
at org.jetbrains.research.kotoed.util.Playground.testStuff(Playground.kt:21) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |
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
package org.jetbrains.research.kotoed.util | |
import kotlinx.coroutines.experimental.Unconfined | |
import kotlinx.coroutines.experimental.launch | |
import org.junit.Test | |
import kotlin.coroutines.experimental.suspendCoroutine | |
import kotlin.reflect.KProperty | |
class Playground { |
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
data class UncookedAnnotation(val name: String, val params: Map<String, Any?>) | |
val KType.uncookedAnnotations | |
get() = this.kotlinType.annotations.map { desc -> | |
UncookedAnnotation( | |
kotlin.reflect.jvm.internal.impl.renderer.DescriptorRenderer.FQ_NAMES_IN_TYPES.renderType(desc.type), | |
desc.allValueArguments.asSequence().map { (k, v) -> Pair("${k.name}", v.value) }.toMap() | |
) | |
} |