Possibly incorrect desugaring of compound assignment with explicit extension method invocations #39527
Labels
area-front-end
Use area-front-end for front end / CFE / kernel format related issues.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Consider the following program:
This program is accepted by the analyzer, but rejected by
dart
from commit ee8d9d2, with the following error:The comments indicate why this should not be an error: The two-step desugaring of the pre-increment produces
Extension1(c)[42] = Extension1(c)[42] - 1
. This is an explicit invocation of theoperator []=
fromExtension1
; the second argument isExtension1(c)[42] - 1
, which is an explicit invocation ofoperator []
fromExtension1
, yielding a result of typeC
, on which we calloperator -(int)
(an implicitly resolved method fromExtension1
). All the types add up as they should, and I believe this is a bug in the front end (presumably in the desugaring steps, because the manual desugaring eliminates the error).The text was updated successfully, but these errors were encountered: