Fixed
Status Update
Comments
yb...@google.com <yb...@google.com>
ap...@google.com <ap...@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
da...@google.com <da...@google.com> #3
A fox for this issue will be available in Room 2.1.0-alpha02
[Deleted User] <[Deleted User]> #5
delete
[Deleted User] <[Deleted User]> #6
delete
Description
Version used: 2.0.0
Devices/Android versions reproduced on: N / A
@Dao
interface Foo {
@Query("SELECT * FROM bar")
fun getAll(): List<Bar>
@Transaction
fun getTransactionAll(): List<Bar> {
return getAll()
}
}
It generates
Foo.DefaultImpls.getTransactionAll(this, )
which cause the error (illegal start of expression) because of the extra comma.