Skip to content
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

Top-level functions. #56

Merged
merged 1 commit into from
May 15, 2017
Merged

Conversation

swankjesse
Copy link
Member

No description provided.

@@ -227,6 +227,12 @@ class KotlinFile private constructor(builder: KotlinFile.Builder) {
return this
}

fun addFun(funSpec: FunSpec): Builder {
require (!funSpec.isConstructor) { "cannot add a constructor to file $fileName" }
Copy link
Member

Choose a reason for hiding this comment

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

nit: extra space

Copy link
Member Author

Choose a reason for hiding this comment

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

Subconsciously, check and require feel sooo keywordey

val source = KotlinFile.builder(tacosPackage, "Taco")
.addFun(FunSpec.builder("a").build())
.addType(TypeSpec.classBuilder("B").build())
.addFun(FunSpec.builder("c").build())
Copy link
Member

Choose a reason for hiding this comment

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

Can you make one of these explicitly PUBLIC and ensure the modifier isn't emitted?

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@swankjesse swankjesse force-pushed the jwilson.0514.top_level_functions branch from b71198a to 486f6c7 Compare May 15, 2017 02:55
@swankjesse
Copy link
Member Author

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

@swankjesse swankjesse merged commit 7dd8e19 into master May 15, 2017
@swankjesse swankjesse deleted the jwilson.0514.top_level_functions branch May 16, 2017 03:08
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.

None yet

2 participants