QQ: Just want to confirm something real quick: I h...
# community-support
k
QQ: Just want to confirm something real quick: I have this:
Copy code
interface MyDomainObject {
  val isSomething: Property<Boolean>
}
and I am getting an error like
Copy code
> Could not create an instance of type MyDomainObject
   > Could not generate a decorated class for type MyDomainObject
      > Cannot have abstract method MyDomainObject.isSomething()
This all has something to do with the fact that we have a property named
isSomething
, right?
m
Yes. kotlinc creates
Copy code
public abstract Property<Boolean> isSomething();
Gradle sees that it doesn’t return a boolean value and understands that as a method (instead of a property)
If you remove the
is
prefix it will work again
I’d be curious to know why the restriction
t
You could also use
@get:JvmName("getIsSomething")
(or getSomething if you prefer), that would help with Groovy DSL while keeping the Kotlin DSL the same (with the
is
prefix).
e