Allow data classes as sealed class subclasses.
sealed class Base {
data class Derived(...) : Base()
}
// Usage: gradle -b get-jar-from-gradle-dependency.gradle | |
apply plugin: 'java' | |
repositories { | |
mavenCentral() | |
jcenter() | |
} | |
dependencies { |
#!/usr/bin/env bash | |
set -e | |
if uname | grep -q Darwin; then | |
# Use Homebrew's coreutils on macOS (run `brew install coreutils`). | |
TOUCH=gtouch | |
STAT=gstat | |
else | |
TOUCH=touch |
#!/usr/bin/env python3 | |
import atexit, os, re, shutil, subprocess, sys, time | |
from pathlib import Path | |
def to_str(buf): | |
return "".join(map(chr, buf)) | |
def dump_stdout_stderr(f, result): | |
f.write("=== STDOUT ===\n\n") |
import org.jetbrains.kotlin.serialization.jvm.* | |
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") | |
fun loadOriginName(className: String) { | |
val metadata = Class.forName(className).declaredAnnotations | |
.filter { it.annotationClass.qualifiedName == "kotlin.Metadata" } | |
.single() as Metadata | |
if (metadata.k == 3 && metadata.d1.isNotEmpty()) { | |
// Synthetic classes generated for lambdas/coroutines |
import java.lang.reflect.* | |
import kotlin.reflect.KClass | |
import kotlin.reflect.KType | |
import kotlin.reflect.KTypeProjection | |
import kotlin.reflect.KVariance | |
import kotlin.reflect.full.createType | |
// --- Interface --- | |
inline fun <reified T : Any> getKType(): KType = |
I hereby claim:
To claim this, I am signing this object:
@file:suppress("UNCHECKED_CAST", "BASE_WITH_NULLABLE_UPPER_BOUND", "UNUSED_PARAMETER") | |
interface KElement | |
// Class, package, type | |
interface KDeclarationContainer : KElement { | |
val allMembers: Collection<KElement> | |
} |
class A { void foo() {} } | |
class a { } | |
public class Main { | |
public static void main(String[] args) { | |
new A().foo(); | |
} | |
} |
#include <cstdio> | |
#include <vector> | |
#include <sndfile.h> | |
using namespace std; | |
int main() { | |
SF_INFO sfinfo; | |
const int BUF_LEN = 2048; |