You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Kotlin code below generates invalid code in 2.40.2; works fine in 2.39.1 and prior:
class LifecycleTracker @AssistedInject internal constructor(
@Assisted lifecycle: Lifecycle,
private val analytics: FirebaseAnalytics,
@Assisted private val myName: String
) : DefaultLifecycleObserver {
@AssistedFactory
sealed interface Factory {
operator fun Lifecycle.invoke(myName: String): LifecycleTracker
}
// ...
}
This generates the following Java code, which has a duplicate variable name in the invoke method; looks related to using a receiver instead of a parameter for Lifecycle:
@DaggerGenerated
@Generated(
value = "dagger.internal.codegen.ComponentProcessor",
comments = "https://dagger.dev"
)
@SuppressWarnings({
"unchecked",
"rawtypes"
})
public final class LifecycleTracker_Factory_Impl implements LifecycleTracker.Factory {
private final LifecycleTracker_Factory delegateFactory;
LifecycleTracker_Factory_Impl(LifecycleTracker_Factory delegateFactory) {
this.delegateFactory = delegateFactory;
}
@Override
public LifecycleTracker invoke(Lifecycle myName, String myName) {
return delegateFactory.get(myName, myName);
}
public static Provider<LifecycleTracker.Factory> create(
LifecycleTracker_Factory delegateFactory) {
return InstanceFactory.create(new LifecycleTracker_Factory_Impl(delegateFactory));
}
}
The build error is variable myName is already defined in method invoke
In 2.39.1 the generated variable name for the receiver in the generated invoke method is $this$invoke.
The text was updated successfully, but these errors were encountered:
This CL replaces all usages of XProcessing getName() with a utility class XElements#getSimpleName(XElement) which ensures we use the javac simple name for now.
Fixes#3065
RELNOTES=N/A
PiperOrigin-RevId: 412072237
This CL replaces all usages of XProcessing getName() with a utility class XElements#getSimpleName(XElement) which ensures we use the javac simple name for now.
Fixes#3065
RELNOTES=N/A
PiperOrigin-RevId: 412072237
The Kotlin code below generates invalid code in 2.40.2; works fine in 2.39.1 and prior:
This generates the following Java code, which has a duplicate variable name in the
invoke
method; looks related to using a receiver instead of a parameter forLifecycle
:The build error is
variable myName is already defined in method invoke
In 2.39.1 the generated variable name for the receiver in the generated
invoke
method is$this$invoke
.The text was updated successfully, but these errors were encountered: