You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks to @athomas for raising this issue. Consider the following program:
extensionHashAllonIterable {
inthashAll() =>0;
}
extensionHashAllListonList {
inthashAll() =>1;
}
voidmain() {
List l = [];
Iterable i = [];
print(l.hashAll());
print(i.hashAll());
}
The CFE (using dart from commit 20b5602) reports a conflict with a static member of the class Object:
n008.dart:2:7: Error: This extension member conflicts with Object member 'hashAll'.
int hashAll() {
^^^^^^^
n008.dart:8:7: Error: This extension member conflicts with Object member 'hashAll'.
int hashAll() {
^^^^^^^
However, I cannot find a justification in the specification documents that any such conflict should be reported. Intuitively, it would not be a conflict anyway, because access to the static method hashAll in Object would have to use the syntax Object.hashAll or prefix.Object.hashAll everywhere outside the class Object itself, and those forms cannot be an access to the extension methods shown above (assuming that Object resolves to the built-in class and hasn't been shadowed by declaration like a local variable).
I believe the conflict should not be reported. The behavior is CFE specific, the analyzer doesn't report a conflict.
The text was updated successfully, but these errors were encountered:
Thanks to @athomas for raising this issue. Consider the following program:
The CFE (using
dart
from commit 20b5602) reports a conflict with a static member of the classObject
:However, I cannot find a justification in the specification documents that any such conflict should be reported. Intuitively, it would not be a conflict anyway, because access to the static method
hashAll
inObject
would have to use the syntaxObject.hashAll
orprefix.Object.hashAll
everywhere outside the classObject
itself, and those forms cannot be an access to the extension methods shown above (assuming thatObject
resolves to the built-in class and hasn't been shadowed by declaration like a local variable).I believe the conflict should not be reported. The behavior is CFE specific, the analyzer doesn't report a conflict.
The text was updated successfully, but these errors were encountered: