mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
[VM/Runtime] Fix error message from type error exception string.
(Should fix https://github.com/dart-lang/sdk/issues/50756) TEST=ci Change-Id: Id605aac4157c774c51577603d77e8ce21f58bd40 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282123 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
parent
41d6db8ce5
commit
3a096ab1ce
1 changed files with 8 additions and 4 deletions
|
@ -912,10 +912,14 @@ void Exceptions::CreateAndThrowTypeError(TokenPosition location,
|
|||
pieces.Add(String::Handle(zone, dst_type.UserVisibleName()));
|
||||
pieces.Add(Symbols::SingleQuote());
|
||||
if (dst_name.Length() > 0) {
|
||||
pieces.Add(Symbols::SpaceOfSpace());
|
||||
pieces.Add(Symbols::SingleQuote());
|
||||
pieces.Add(dst_name);
|
||||
pieces.Add(Symbols::SingleQuote());
|
||||
if (dst_name.ptr() == Symbols::InTypeCast().ptr()) {
|
||||
pieces.Add(dst_name);
|
||||
} else {
|
||||
pieces.Add(Symbols::SpaceOfSpace());
|
||||
pieces.Add(Symbols::SingleQuote());
|
||||
pieces.Add(dst_name);
|
||||
pieces.Add(Symbols::SingleQuote());
|
||||
}
|
||||
}
|
||||
// Print ambiguous URIs of src and dst types.
|
||||
URIs uris(zone, 12);
|
||||
|
|
Loading…
Reference in a new issue