Kotlin / kotlin-by-example

The sources of Kotlin by Example.
https://play.kotlinlang.org/byExample/overview
MIT License
460 stars 897 forks source link

HTML Builder example produces deprecation warning and is not aligned with Type Safe Builders reference doc #123

Closed VasylTretiakov closed 4 years ago

VasylTretiakov commented 4 years ago

Running the HTML Builder example code in the https://play.kotlinlang.org/byExample/09_Kotlin_JS/06_HtmlBuilder page produces the expected result while displaying deprecation warnings next to several lines (please refer to the screenshot below).

kotlin example warnings

Attempt to run the code in Kotlin Playground fails with errors (please refer to the screenshot below).

kotlin playground errors

The Type Sage Builders reference doc mentioned at the bottom of the page contains a different implementation that [after minor adaptations] runs successfully in Kotlin Playground.

It seems beneficial to align HTML Builder example with with Type Safe Builders reference doc and make it executable in Kotlin Playground.

p7nov commented 4 years ago

Fixed in PR #124 by @VasylTretiakov.