We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say we have a writable like this one:
fun renderObject(): Writable = writable { rust("""let mystring = String::from("Weeeeeeeee");"""); }
The writable can be interpolated in any rustTemplate like this:
rustTemplate
rustTemplate("#{myobject:W}", "myobject" to renderObject())
If I setup the context using a camelcase identifier (IE myObject instead of myobject), it results in a Kotlin stacktrace:
myObject
myobject
Projection pokemon_service_sdk failed: java.lang.NullPointerException: Parameter specified as non-null is null: method software.amazon.smithy.rust.codegen.rustlang.RustWriter$RustWriteableInjector.apply, parameter t software.amazon.smithy.rust.codegen.rustlang.RustWriter$RustWriteableInjector.apply(RustWriter.kt) software.amazon.smithy.rust.codegen.rustlang.RustWriter$RustWriteableInjector.apply(RustWriter.kt:516) software.amazon.smithy.utils.AbstractCodeWriter.applyFormatter(AbstractCodeWriter.java:1861) software.amazon.smithy.utils.CodeFormatter$Operation.lambda$formatted$1(CodeFormatter.java:108) software.amazon.smithy.utils.CodeFormatter$BlockOperation$Unconditional.apply(CodeFormatter.java:228) software.amazon.smithy.utils.CodeFormatter.run(CodeFormatter.java:41) software.amazon.smithy.utils.AbstractCodeWriter.format(AbstractCodeWriter.java:1596) software.amazon.smithy.utils.AbstractCodeWriter.write(AbstractCodeWriter.java:1652) software.amazon.smithy.rust.codegen.rustlang.RustWriter.write(RustWriter.kt:363) software.amazon.smithy.rust.codegen.rustlang.RustWriterKt$rustTemplate$1.invoke(RustWriter.kt:189) software.amazon.smithy.rust.codegen.rustlang.RustWriterKt$rustTemplate$1.invoke(RustWriter.kt:188) software.amazon.smithy.rust.codegen.rustlang.RustWriterKt.withTemplate(RustWriter.kt:91) software.amazon.smithy.rust.codegen.rustlang.RustWriterKt.rustTemplate(RustWriter.kt:188) software.amazon.smithy.rust.codegen.server.python.smithy.generators.PythonServerEnumGenerator.renderPyO3Methods(PythonServerEnumGenerator.kt:56) software.amazon.smithy.rust.codegen.server.python.smithy.generators.PythonServerEnumGenerator.render(PythonServerEnumGenerator.kt:46) software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerCodegenVisitor$stringShape$1$1.invoke(PythonServerCodegenVisitor.kt:163) software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerCodegenVisitor$stringShape$1$1.invoke(PythonServerCodegenVisitor.kt:162) software.amazon.smithy.rust.codegen.smithy.RustCrate.useShapeWriter$lambda-0(CodegenDelegator.kt:60) software.amazon.smithy.codegen.core.WriterDelegator.useShapeWriter(WriterDelegator.java:208) software.amazon.smithy.rust.codegen.smithy.RustCrate.useShapeWriter(CodegenDelegator.kt:60) software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerCodegenVisitor.stringShape(PythonServerCodegenVisitor.kt:162) software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerCodegenVisitor.stringShape(PythonServerCodegenVisitor.kt:42) software.amazon.smithy.model.shapes.StringShape.accept(StringShape.java:41) software.amazon.smithy.rust.codegen.server.python.smithy.PythonServerCodegenVisitor.execute(PythonServerCodegenVisitor.kt:105) software.amazon.smithy.rust.codegen.server.python.smithy.PythonCodegenServerPlugin.execute(PythonCodegenServerPlugin.kt:47) software.amazon.smithy.build.SmithyBuildImpl.applyPlugin(SmithyBuildImpl.java:397) software.amazon.smithy.build.SmithyBuildImpl.applyProjection(SmithyBuildImpl.java:328) software.amazon.smithy.build.SmithyBuildImpl.executeSerialProjection(SmithyBuildImpl.java:224) software.amazon.smithy.build.SmithyBuildImpl.lambda$applyAllProjections$5(SmithyBuildImpl.java:189) java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
The text was updated successfully, but these errors were encountered:
Had reported to @rcoh - there should be a fix being worked on?
Sorry, something went wrong.
Fixes for RustWriter bugs #1465 & #1459
4b95a45
f4fd787
Fixes for RustWriter bugs #1465 & #1459 (#1467)
b45c1f0
50ce747
Writer fixes (#1469)
898dc70
* Fixes for RustWriter bugs #1465 & #1459 * Fix behavior causing extra newlines in docs
Successfully merging a pull request may close this issue.
Let's say we have a writable like this one:
The writable can be interpolated in any
rustTemplate
like this:If I setup the context using a camelcase identifier (IE
myObject
instead ofmyobject
), it results in a Kotlin stacktrace:The text was updated successfully, but these errors were encountered: