https://kotlinlang.org logo
z

Zach Klippenstein (he/him) [MOD]

05/28/2020, 3:31 AM
For the new
StateFlow<T>.collectAsFlow()
extension introduced in dev12 (https://android-review.googlesource.com/c/platform/frameworks/support/+/1308154), why does
T
have a non-null upper bound? `StateFlow`’s
T
is nullable, and I don’t see why this bound should be required for the extension.
The definition of the function in question is:
Copy code
inline fun <T : Any> StateFlow<T>.collectAsState(
    context: CoroutineContext = Dispatchers.Main
): State<T> = collectAsState(value, context)
l

Leland Richardson [G]

05/28/2020, 4:26 AM
Looks like a mistake to me
z

Zach Klippenstein (he/him) [MOD]

05/28/2020, 4:55 AM
👍 I'll file a bug
j

jw

05/28/2020, 1:06 PM
Send the fix yourself! It's easier than you think!
You can have the codebase open in an IDE in 4 commands:
brew install repo
, make and cd into a directory,
repo init ...
(steal from readme),
repo sync -j16
,
./studiow
💥 !
👍 2
Actually for compose you need to do
./ui/studiow
I think
a

Andrey Kulikov

05/28/2020, 1:25 PM
indeed, it should be just
<T>
, thanks for noticing. did you file a bug?
or yes, feel free to contribute the fix!
z

Zach Klippenstein (he/him) [MOD]

05/28/2020, 9:20 PM
I filed https://issuetracker.google.com/issues/157674865 and I am working on submitting a fix, but having trouble getting AS to sync and see the test code as code.
How do I generate a
Change-Id
for the commit?
a

Andrey Kulikov

05/28/2020, 9:44 PM
there is a precommit hook which will add it for you
j

jw

05/29/2020, 12:48 AM
First one is the hardest. Make sure you use your work email as the git author we have an company-wide CLA in place. You might need added to a google group internally though....
z

Zach Klippenstein (he/him) [MOD]

05/29/2020, 12:55 AM
I’m getting this error when running `repo upload …`:
Copy code
[FAILED] commit_msg_changeid_field
    Commit message is missing a "Change-Id:" line.  It must match the
    following case-sensitive regex:

        ^Change-Id: I[a-f0-9]+$