For the following Dart class "FooBar":
class FooBar {
const FooBar();
}
The following kernel structure is generated:
class FooBar extends core::Object /*hasConstConstructor*/ {
const constructor •() → min::FooBar
: super core::Object::•()
;
static method _#new#tearOff() → min::FooBar
return new min::FooBar::•(); /* this is a non-const constructor invocation */
method noOp() → void {}
}
Therefore every class will have an auto-generated static method that invokes it's unnamed constructor in a non-const context. This doesn't affect the const_finder for AOT builds, since TFA will eliminate these static methods (unless a tear-off is actually used). However, for web dills, these will still be present.