[L] Change in dart/sdk[main]: [kernel] Implement InvalidInitializer

0 views
Skip to first unread message

Johnni Winther (Gerrit)

unread,
Nov 26, 2025, 6:16:47 AM (3 days ago) Nov 26
to Jens Johansen, Alexander Markov, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Markov and Jens Johansen

Johnni Winther voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
  • Jens Johansen
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
Gerrit-Change-Number: 463661
Gerrit-PatchSet: 3
Gerrit-Owner: Johnni Winther <johnni...@google.com>
Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
Gerrit-Reviewer: Jens Johansen <je...@google.com>
Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
Gerrit-Attention: Jens Johansen <je...@google.com>
Gerrit-Attention: Alexander Markov <alexm...@google.com>
Gerrit-Comment-Date: Wed, 26 Nov 2025 11:16:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Jens Johansen (Gerrit)

unread,
Nov 27, 2025, 1:48:39 AM (2 days ago) Nov 27
to Johnni Winther, Alexander Markov, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Alexander Markov and Johnni Winther

Jens Johansen voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alexander Markov
  • Johnni Winther
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Alexander Markov <alexm...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 06:48:31 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Martin Kustermann (Gerrit)

    unread,
    Nov 27, 2025, 4:02:19 AM (2 days ago) Nov 27
    to Johnni Winther, Alexander Markov, Jens Johansen, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov and Johnni Winther

    Martin Kustermann voted and added 2 comments

    Votes added by Martin Kustermann

    Code-Review+1

    2 comments

    File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    Line 346, Patchset 4 (Latest): case kInvalidInitializer: {
    Martin Kustermann . unresolved

    Do invalid initializers not cause compile-time errors?

    AFAIK the VM shouldn't receive any kernel AST with compile-time errors in them. So I would assume this to be unreachable, which is probably why it was `UNIMPLEMENTED()` before

    File runtime/vm/compiler/frontend/kernel_fingerprints.cc
    Line 196, Patchset 4 (Latest): ReadPosition(); // read position.
    Martin Kustermann . unresolved

    ditto about `UNIMPLEMENTED()` if this can only happen in compile-time error scenarios

    (also in other such `case kInvalidInitializer` places in this CL)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    • Johnni Winther
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 09:02:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Johnni Winther (Gerrit)

    unread,
    Nov 27, 2025, 4:06:57 AM (2 days ago) Nov 27
    to Martin Kustermann, Alexander Markov, Jens Johansen, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov and Martin Kustermann

    Johnni Winther added 1 comment

    File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    Line 346, Patchset 4 (Latest): case kInvalidInitializer: {
    Martin Kustermann . unresolved

    Do invalid initializers not cause compile-time errors?

    AFAIK the VM shouldn't receive any kernel AST with compile-time errors in them. So I would assume this to be unreachable, which is probably why it was `UNIMPLEMENTED()` before

    Johnni Winther

    `InvalidInitializer`s are preceded by compile time errors, similar to `InvalidExpression`s. Normally this result in the VM not running the code, but if you compile to .dill and then run the .dill you *can* encounter them.

    The change mimicks the behavior for `InvalidExpression`s.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    • Martin Kustermann
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Martin Kustermann <kuste...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 09:06:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
    satisfied_requirement
    open
    diffy

    Martin Kustermann (Gerrit)

    unread,
    Nov 27, 2025, 4:12:12 AM (2 days ago) Nov 27
    to Johnni Winther, Alexander Markov, Jens Johansen, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov and Johnni Winther

    Martin Kustermann added 1 comment

    File runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    Line 346, Patchset 4 (Latest): case kInvalidInitializer: {
    Martin Kustermann . resolved

    Do invalid initializers not cause compile-time errors?

    AFAIK the VM shouldn't receive any kernel AST with compile-time errors in them. So I would assume this to be unreachable, which is probably why it was `UNIMPLEMENTED()` before

    Johnni Winther

    `InvalidInitializer`s are preceded by compile time errors, similar to `InvalidExpression`s. Normally this result in the VM not running the code, but if you compile to .dill and then run the .dill you *can* encounter them.

    The change mimicks the behavior for `InvalidExpression`s.

    Martin Kustermann

    Marked as resolved.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    • Johnni Winther
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Johnni Winther <johnni...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 09:12:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Martin Kustermann <kuste...@google.com>
    Comment-In-Reply-To: Johnni Winther <johnni...@google.com>
    satisfied_requirement
    open
    diffy

    Johnni Winther (Gerrit)

    unread,
    Nov 27, 2025, 4:23:39 AM (2 days ago) Nov 27
    to Martin Kustermann, Alexander Markov, Jens Johansen, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov

    Johnni Winther added 1 comment

    File runtime/vm/compiler/frontend/kernel_fingerprints.cc
    Line 196, Patchset 4 (Latest): ReadPosition(); // read position.
    Martin Kustermann . resolved

    ditto about `UNIMPLEMENTED()` if this can only happen in compile-time error scenarios

    (also in other such `case kInvalidInitializer` places in this CL)

    Johnni Winther

    Marked as resolved.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 09:23:32 +0000
    satisfied_requirement
    open
    diffy

    Johnni Winther (Gerrit)

    unread,
    Nov 27, 2025, 4:53:13 AM (2 days ago) Nov 27
    to Martin Kustermann, Alexander Markov, Jens Johansen, Commit Queue, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org
    Attention needed from Alexander Markov

    Johnni Winther voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alexander Markov
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedCommit-Message-Has-TEST
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 4
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Jens Johansen <je...@google.com>
    Gerrit-Reviewer: Johnni Winther <johnni...@google.com>
    Gerrit-Reviewer: Martin Kustermann <kuste...@google.com>
    Gerrit-CC: Alexander Markov <alexm...@google.com>
    Gerrit-Attention: Alexander Markov <alexm...@google.com>
    Gerrit-Comment-Date: Thu, 27 Nov 2025 09:53:07 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Commit Queue (Gerrit)

    unread,
    Nov 27, 2025, 4:53:28 AM (2 days ago) Nov 27
    to Johnni Winther, Martin Kustermann, Alexander Markov, Jens Johansen, dart-fe-te...@google.com, dart-vm-compil...@google.com, rev...@dartlang.org, vm-...@dartlang.org

    Commit Queue submitted the change

    Change information

    Commit message:
    [kernel] Implement InvalidInitializer

    This updates the Initializer classes such that InvalidInitializer has a message and will throw at runtime, similar to InvalidExpression. All initializers have positions and only FieldInitializer and SuperInitializer have an isSynthetic field.

    TEST=pkg/front_end/testcases/general/invalid_initializer.dart
    Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Reviewed-by: Martin Kustermann <kuste...@google.com>
    Commit-Queue: Johnni Winther <johnni...@google.com>
    Reviewed-by: Jens Johansen <je...@google.com>
    Files:
    • M pkg/front_end/lib/src/kernel/kernel_target.dart
    • A pkg/front_end/testcases/general/invalid_initializer.dart
    • A pkg/front_end/testcases/general/invalid_initializer.dart.strong.expect
    • A pkg/front_end/testcases/general/invalid_initializer.dart.strong.modular.expect
    • A pkg/front_end/testcases/general/invalid_initializer.dart.strong.outline.expect
    • A pkg/front_end/testcases/general/invalid_initializer.dart.strong.transformed.expect
    • A pkg/front_end/testcases/general/invalid_initializer.dart.textual_outline.expect
    • A pkg/front_end/testcases/general/invalid_initializer.dart.textual_outline_modelled.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.strong.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.strong.modular.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.strong.outline.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.strong.transformed.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.textual_outline.expect
    • A pkg/front_end/testcases/general/invalid_initializer2.dart.textual_outline_modelled.expect
    • M pkg/front_end/testcases/strong.status
    • M pkg/kernel/binary.md
    • M pkg/kernel/lib/binary/ast_from_binary.dart
    • M pkg/kernel/lib/binary/ast_to_binary.dart
    • M pkg/kernel/lib/binary/tag.dart
    • M pkg/kernel/lib/clone.dart
    • M pkg/kernel/lib/src/ast/dummies.dart
    • M pkg/kernel/lib/src/ast/initializers.dart
    • M pkg/kernel/lib/src/equivalence.dart
    • M pkg/kernel/lib/src/node_creator.dart
    • M runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
    • M runtime/vm/compiler/frontend/kernel_fingerprints.cc
    • M runtime/vm/compiler/frontend/kernel_translation_helper.cc
    • M runtime/vm/compiler/frontend/scope_builder.cc
    • M runtime/vm/kernel_binary.h
    Change size: L
    Delta: 30 files changed, 396 insertions(+), 89 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Martin Kustermann, +1 by Jens Johansen
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: sdk
    Gerrit-Branch: main
    Gerrit-Change-Id: Ic444bb1dc273b433ac70249240527d115deaa332
    Gerrit-Change-Number: 463661
    Gerrit-PatchSet: 5
    Gerrit-Owner: Johnni Winther <johnni...@google.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages