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

Add support for anonymous functions #479

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Egorand
Copy link
Collaborator

@Egorand Egorand commented Sep 16, 2018

Closes #474

@@ -152,6 +153,8 @@ class ParameterSpec private constructor(builder: ParameterSpec.Builder) {
@JvmStatic fun unnamed(type: Type) = unnamed(type.asTypeName())

@JvmStatic fun unnamed(type: TypeName) = Builder("", type).build()

@JvmStatic fun untyped(name: String) = Builder(name, null).build()
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit skeptical about needing to support this. Can we leave it out and see if anyone ever complains?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure

@@ -366,8 +370,8 @@ class FunSpec private constructor(builder: Builder) {
internal const val GETTER = "get()"
internal const val SETTER = "set()"

internal val String.isConstructor get() = this == CONSTRUCTOR
internal val String.isAccessor get() = this.isOneOf(GETTER, SETTER)
internal val String?.isConstructor get() = this == CONSTRUCTOR
Copy link
Member

Choose a reason for hiding this comment

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

=== ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

..although technically this is what String.equals() already does, but semantically I like === better

@Egorand Egorand force-pushed the egorand/0916/anonymous-functions branch from b791061 to bd06fc1 Compare October 14, 2018 01:06
@Egorand Egorand changed the base branch from master to main July 5, 2023 09:21
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

3 participants