Skip to content

Add support for anonymous functions - #479

Open
Egorand wants to merge 1 commit into
mainfrom
egorand/0916/anonymous-functions
Open

Add support for anonymous functions#479
Egorand wants to merge 1 commit into
mainfrom
egorand/0916/anonymous-functions

Conversation

@Egorand

@Egorand Egorand commented Sep 16, 2018

Copy link
Copy Markdown
Collaborator

Closes #474


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

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

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure


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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

=== ?

Copy link
Copy Markdown
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
Copy Markdown
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.

3 participants