sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Missing quick-fixes on pattern destructuring

Open FMorschel opened this issue 1 month ago • 1 comments

Repro:

// other.dart
class A {}

void f(A a) {
  switch (a) {
    case A(value:int other):
      break;
  }
}

// import.dart
import 'other.dart';

extension Ext on A {
  int? get value => null;
}
Image

If the type is declared somewhere else where we can't edit (SDK or a package), then neither the Create field/Create getter fixes show up.

Missing here:

  • Create extension quick-fixes
  • Add import for the extension

FYI @bwilkerson @DanTup

FMorschel avatar Oct 31 '25 17:10 FMorschel