Fixed
Status Update
Comments
da...@google.com <da...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 15:25:27 2018
Generate correct code for a no argument Kotlin default DAO function.
Kotlin default functions takes 'this' as first parameter and Room
was generating code that passed it but also added a comma thinking
more parameters where to be appended, but on a no arg function, the
comma was kept followed by a closing parenthesis causing wrong code
to be generated.
This change fixes the issue by removing the comma when appending 'this',
but always prefixing a comma on all parameters if the call type is
DEFAULT_KOTLIN.
Bug: 117527454
Test: ./gradlew :room:integration-tests:kotlintestapp:cC
Change-Id: I5792280b85c66f90da3485767e480300ee72bda5
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
https://android-review.googlesource.com/798412
https://goto.google.com/android-sha1/afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Branch: androidx-master-dev
commit afc23fbda873bf19c761bc0f124c99ff4b1a99e9
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Mon Oct 22 15:25:27 2018
Generate correct code for a no argument Kotlin default DAO function.
Kotlin default functions takes 'this' as first parameter and Room
was generating code that passed it but also added a comma thinking
more parameters where to be appended, but on a no arg function, the
comma was kept followed by a closing parenthesis causing wrong code
to be generated.
This change fixes the issue by removing the comma when appending 'this',
but always prefixing a comma on all parameters if the call type is
DEFAULT_KOTLIN.
Bug: 117527454
Test: ./gradlew :room:integration-tests:kotlintestapp:cC
Change-Id: I5792280b85c66f90da3485767e480300ee72bda5
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
ap...@google.com <ap...@google.com> #3
A fox for this issue will be available in Room 2.1.0-alpha02
Description
@Entity(tableName = "purchase_table", ignoredColumns = arrayOf("mParsedJson"))
class CachedPurchase(mOriginalJson: String, mSignature: String) : Purchase(mOriginalJson, mSignature) {
@PrimaryKey(autoGenerate = true)
var id: Int = 0
}
Error:
Room actually generates the correct code, but the compiler still complains about the ignored fields, i.e., "mParsedJson"