Comments (2)
Yeah it looks like a bug that we drop that on the floor silently.
However, you can achieve what you want with addSuperclassConstructorParameter
which is the function you are searching for. This goes on the TypeSpec
builder, not the FunSpec
builder.
Here's an example:
kotlinpoet/kotlinpoet/src/commonTest/kotlin/com/squareup/kotlinpoet/TypeSpecTest.kt
Lines 3833 to 3848 in 9120a65
from kotlinpoet.
That works perfectly, I was looking at the FunSpec and didn't see any other options.
from kotlinpoet.
Related Issues (20)
- Generic super interface HOT 3
- CodeBlock composition: statement within statement is not supported HOT 5
- Composition vs. newlines
- Wrapping inside long statements is weird HOT 4
- Single-expression function transformation messes up the indentation HOT 1
- Ksp function times lose nullability HOT 5
- CodeWriter generates wrong nullable type in function body HOT 2
- When using a property initializer in a primary constructor, the annotations don't have the correct use-site target HOT 4
- Chained constructor call is not formatted correctly
- Move Gradle Wrapper validation to its own action
- Can't generate @get:JvmName annotation for property HOT 5
- Can we add IDE highlighting to addStatement or similar statements HOT 4
- kotlin.* imports in generated classes HOT 1
- There is no way to add format strings to the code HOT 2
- Support at least few Kotlin API targets via apiVersion to simplify migrations
- Split the KotlinPoet documentation page into multiple subpages
- addKdoc not working as expected when property is involved HOT 2
- com.squareup:kotlinpoet 1.15.3 missing class files. HOT 3
- Code generated with ksp interop's toAnnotationSpec() generates code that fails to compile when passed an OptIn annotation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlinpoet.