Skip to content

minor fix for typo, indent, link, and sample code, etc #4993

New issue

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LiYing2010
Copy link
Contributor

Change List

  • fixed code style of sample code
  • fixed language of sample code
  • fixed some incorrect content

@LiYing2010 LiYing2010 requested a review from a team as a code owner August 5, 2025 10:13
@@ -100,7 +100,7 @@ You can enable all the supported ES2015 features at once by adding the `es2015`

```kotlin
tasks.withType<KotlinJsCompile>().configureEach {
kotlinOptions {
compilerOptions {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI
IMO:
kotlinOptions is deprecated, should use compilerOptions instead

Comment on lines +307 to +312
If you wanted to create a new class which implements the `Drawable` interface, and have the same behavior with `Circle`
class **except** for the value of the `color` property, you still need to add implementations for each member function
of the `Drawable` interface:

```kotlin
class RedCircle(val circle: Circle) : Circle {

class RedCircle(val circle: Circle) : Drawable {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI
IMO:
if class RedCircle extends class Circle, it will inherit all the member functions, which means there will be no necessary to implement func draw() and resize()

so I think the sample code here will confuse the readers, and I suggest to change it

@@ -37,7 +37,7 @@ Create a project using the Kotlin Multiplatform wizard:
>
{style="note"}

2. In **composeApp** | **Tasks** | **kotlin browser**, select and run the **wasmJsBrowserDevelopmentRun** task.
2. In **wasmdemo** | **Tasks** | **kotlin browser**, select and run the **wasmJsBrowserDevelopmentRun** task.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI
the demo project name was changed to WasmDemo, but this content still use the old name composeApp

@@ -235,7 +235,7 @@ This feature tells the compiler to apply the annotation to all relevant parts of

* **`get`**: the getter method.

* **`set_param`**: the parameter of the setter method, if the property is defined as `var`.
* **`setparam`**: the parameter of the setter method, if the property is defined as `var`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO
I think setparam is the correct use-site target name

@sarahhaggarty sarahhaggarty self-assigned this Aug 5, 2025
@LiYing2010
Copy link
Contributor Author

@sarahhaggarty
could you please review this?
thank you~~~

data class Data(val a: Int, val b: String)

fun main() {
val obj = Json.decodeFromString<Data>("""{"a":42, "b": "str"}""")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val obj = Json.decodeFromString<Data>("""{"a":42, "b": "str"}""")
val obj = Json.decodeFromString<Data>("""{"a":42, "b": "str"}""")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

data class Data(val a: Int, val b: String)

fun main() {
val json = Json.encodeToString(Data(42, "str"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val json = Json.encodeToString(Data(42, "str"))
val json = Json.encodeToString(Data(42, "str"))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@LiYing2010 LiYing2010 requested a review from daniCsorbaJB August 5, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants