Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Issue 2993193002: When reordering constructor initializers, use correct types for temp vars. (Closed)

Created:
3 years, 4 months ago by Paul Berry
Modified:
3 years, 4 months ago
Reviewers:
ahe, scheglov
CC:
reviews_dartlang.org, dart-fe-team+reviews_google.com
Target Ref:
refs/heads/master
Visibility:
Public.

Description

When reordering constructor initializers, use correct types for temp vars. In strong mode, when a call to a super-initializer is reordered, we can use the static type of the super-initializer arguments to set the types of the temporary variables that we use to do the reordering. This is desirable because it might help avoid unnecessary casts. In non-strong mode, we use `dynamic` for the temporary variables, to replicate Dart 1.0 behavior. R=scheglov@google.com Committed: https://github.com/dart-lang/sdk/commit/41170b0a1576ab6a52bbd14f5792911089ed7895

Patch Set 1 #

Total comments: 3

Messages

Total messages: 10 (2 generated)
Paul Berry
I only need a review from one of you.
3 years, 4 months ago (2017-08-07 20:32:22 UTC) #2
scheglov
LGTM
3 years, 4 months ago (2017-08-07 20:38:34 UTC) #3
Paul Berry
Committed patchset #1 (id:1) manually as 41170b0a1576ab6a52bbd14f5792911089ed7895 (presubmit successful).
3 years, 4 months ago (2017-08-07 20:55:45 UTC) #5
ahe
lgtm I thought strong mode didn't support moving super, and it's a compile-time error if ...
3 years, 4 months ago (2017-08-08 13:31:18 UTC) #6
Paul Berry
On 2017/08/08 13:31:18, ahe wrote: > lgtm > > I thought strong mode didn't support ...
3 years, 4 months ago (2017-08-08 16:40:05 UTC) #7
Paul Berry
https://codereview.chromium.org/2993193002/diff/1/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart File pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart (right): https://codereview.chromium.org/2993193002/diff/1/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart#newcode426 pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart:426: var type = typeInferrer.typeSchemaEnvironment.strongMode On 2017/08/08 13:31:18, ahe wrote: ...
3 years, 4 months ago (2017-08-08 16:42:25 UTC) #8
ahe
https://codereview.chromium.org/2993193002/diff/1/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart File pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart (right): https://codereview.chromium.org/2993193002/diff/1/pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart#newcode426 pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart:426: var type = typeInferrer.typeSchemaEnvironment.strongMode On 2017/08/08 16:42:25, Paul Berry ...
3 years, 4 months ago (2017-08-08 17:35:44 UTC) #9
ahe
3 years, 4 months ago (2017-08-08 17:36:01 UTC) #10
Message was sent while issue was closed.
On 2017/08/08 16:40:05, Paul Berry wrote:
> On 2017/08/08 13:31:18, ahe wrote:
> > lgtm
> > 
> > I thought strong mode didn't support moving super, and it's a compile-time
> error
> > if it isn't last.
> 
> Whoops, you're right.  Thanks for pointing it out--I had forgotten.
> 
> I think I'm going to leave the changes in place since they will lead to
> (slightly) better behavior in the error-recovered case.  But it's nice to know
> that production code won't have to rely on this :)

I hoped you'd say that :-D

Powered by Google App Engine
This is Rietveld 408576698