Fix reporting of CompileTimeErrorCode.PRIVATE_SETTER

The error code text is:

    The setter '{0}' is private and can't be accessed outside of the
    library that declares it.

So when instantiating this error we should only provide a single
argument.  Previously we were providing a second argument that was the
name of the type.

Change-Id: I952dec86f079b9e17e071d37895c3b38c715cf4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213826
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This commit is contained in:
Paul Berry 2021-09-20 17:52:53 +00:00 committed by commit-bot@chromium.org
parent 3ae5055f75
commit b2347f66ce

View file

@ -492,7 +492,7 @@ class PropertyElementResolver {
_errorReporter.reportErrorForNode(
CompileTimeErrorCode.PRIVATE_SETTER,
propertyName,
[propertyName.name, typeReference.name],
[propertyName.name],
);
}
_checkForStaticAccessToInstanceMember(propertyName, writeElement);