Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart

Issue 2963763002: Change how unresolved super sends are handled. (Closed)
Patch Set: Rebased on 6cb702b723184ef8875871e4c15004d1ea0a8460. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
index e06bbc7d3c64242aa549c5e75875a9cc3f50e0d4..2ff2ecb992a6a80c65139ff008a2e1dd18918e50 100644
--- a/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/frontend_accessors.dart
@@ -373,7 +373,9 @@ class SuperPropertyAccessor extends Accessor {
: super(helper, token);
Expression _makeRead(KernelComplexAssignment complexAssignment) {
- if (getter == null) return makeInvalidRead();
+ if (getter == null) {
+ helper.warnUnresolvedSuperGet(name, offsetForToken(token));
+ }
// TODO(ahe): Use [DirectPropertyGet] when possible.
var read = new KernelSuperPropertyGet(name, getter)
..fileOffset = offsetForToken(token);
@@ -383,7 +385,9 @@ class SuperPropertyAccessor extends Accessor {
Expression _makeWrite(Expression value, bool voidContext,
KernelComplexAssignment complexAssignment) {
- if (setter == null) return makeInvalidWrite(value);
+ if (setter == null) {
+ helper.warnUnresolvedSuperSet(name, offsetForToken(token));
+ }
// TODO(ahe): Use [DirectPropertySet] when possible.
var write = new SuperPropertySet(name, value, setter)
..fileOffset = offsetForToken(token);
@@ -595,12 +599,21 @@ class SuperIndexAccessor extends Accessor {
return new VariableGet(indexVariable);
}
- Expression _makeSimpleRead() => new SuperMethodInvocation(
- indexGetName, new KernelArguments(<Expression>[index]), getter);
+ Expression _makeSimpleRead() {
+ if (getter == null) {
+ helper.warnUnresolvedSuperMethod(indexGetName, offsetForToken(token));
+ }
+ // TODO(ahe): Use [DirectMethodInvocation] when possible.
+ return new SuperMethodInvocation(
+ indexGetName, new KernelArguments(<Expression>[index]), getter);
+ }
Expression _makeSimpleWrite(Expression value, bool voidContext,
KernelComplexAssignment complexAssignment) {
if (!voidContext) return _makeWriteAndReturn(value, complexAssignment);
+ if (setter == null) {
+ helper.warnUnresolvedSuperMethod(indexSetName, offsetForToken(token));
+ }
var write = new SuperMethodInvocation(
indexSetName, new KernelArguments(<Expression>[index, value]), setter)
..fileOffset = offsetForToken(token);
@@ -609,6 +622,9 @@ class SuperIndexAccessor extends Accessor {
}
Expression _makeRead(KernelComplexAssignment complexAssignment) {
+ if (getter == null) {
+ helper.warnUnresolvedSuperMethod(indexGetName, offsetForToken(token));
+ }
var read = new SuperMethodInvocation(
indexGetName, new KernelArguments(<Expression>[indexAccess()]), getter)
..fileOffset = offsetForToken(token);
@@ -619,6 +635,9 @@ class SuperIndexAccessor extends Accessor {
Expression _makeWrite(Expression value, bool voidContext,
KernelComplexAssignment complexAssignment) {
if (!voidContext) return _makeWriteAndReturn(value, complexAssignment);
+ if (setter == null) {
+ helper.warnUnresolvedSuperMethod(indexSetName, offsetForToken(token));
+ }
var write = new SuperMethodInvocation(indexSetName,
new KernelArguments(<Expression>[indexAccess(), value]), setter)
..fileOffset = offsetForToken(token);
@@ -629,6 +648,9 @@ class SuperIndexAccessor extends Accessor {
_makeWriteAndReturn(
Expression value, KernelComplexAssignment complexAssignment) {
var valueVariable = new VariableDeclaration.forValue(value);
+ if (setter == null) {
+ helper.warnUnresolvedSuperMethod(indexSetName, offsetForToken(token));
+ }
var write = new SuperMethodInvocation(
indexSetName,
new KernelArguments(

Powered by Google App Engine
This is Rietveld 408576698