-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-ddc-discrepancyWhen dev and production compilations have different semanticsWhen dev and production compilations have different semanticsweb-dev-compiler
Description
Originally reported here: #54342 (comment)
class CallableObject {
const CallableObject();
void call() {
print("CallableObject called");
}
}
class ValueContainer<T> {
ValueContainer(this.value);
final T value;
final value2 = const CallableObject();
}
void main() {
final b = ValueContainer(const CallableObject());
b.value2(); // Runs correctly and calls the "call" function
b.value.call(); // Also runs correctly
b.value(); // NoSuchMethodError: tried to call a non-function, such as null: 'b.value'
}It looks like DDC interprets b.value() as a method call and not a property get + call. This passes in dart2js.
Metadata
Metadata
Assignees
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-ddc-discrepancyWhen dev and production compilations have different semanticsWhen dev and production compilations have different semanticsweb-dev-compiler