From 2df97ca4c3e2f33680dae70181e06c3dc2fe1349 Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Fri, 26 Jun 2020 16:05:13 +0700 Subject: [PATCH] Update README.md, add suppression --- kmath-ast/README.md | 4 +++- .../kotlin/scientifik/kmath/asm/internal/classWriters.kt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/kmath-ast/README.md b/kmath-ast/README.md index 0e375f14d..12d425460 100644 --- a/kmath-ast/README.md +++ b/kmath-ast/README.md @@ -24,6 +24,7 @@ For example, the following builder: package scientifik.kmath.asm.generated; import java.util.Map; +import scientifik.kmath.asm.internal.MapIntrinsics; import scientifik.kmath.expressions.Expression; import scientifik.kmath.operations.RealField; @@ -37,9 +38,10 @@ public final class AsmCompiledExpression_1073786867_0 implements Expression arguments) { - return (Double)this.algebra.add(((Double)arguments.get("x")).doubleValue(), 2.0D); + return (Double)this.algebra.add(((Double)MapIntrinsics.getOrFail(arguments, "x", (Object)null)).doubleValue(), 2.0D); } } + ``` ### Example Usage diff --git a/kmath-ast/src/jvmMain/kotlin/scientifik/kmath/asm/internal/classWriters.kt b/kmath-ast/src/jvmMain/kotlin/scientifik/kmath/asm/internal/classWriters.kt index 00093aaa7..7f0770b28 100644 --- a/kmath-ast/src/jvmMain/kotlin/scientifik/kmath/asm/internal/classWriters.kt +++ b/kmath-ast/src/jvmMain/kotlin/scientifik/kmath/asm/internal/classWriters.kt @@ -3,6 +3,7 @@ package scientifik.kmath.asm.internal import org.objectweb.asm.ClassWriter import org.objectweb.asm.FieldVisitor +@Suppress("FunctionName") internal inline fun ClassWriter(flags: Int, block: ClassWriter.() -> Unit): ClassWriter = ClassWriter(flags).apply(block)