-
Notifications
You must be signed in to change notification settings - Fork 289
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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() |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
===
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call!
There was a problem hiding this comment.
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
b791061
to
bd06fc1
Compare
Closes #474