Skip to content

Commit 2c81261

Browse files
johnniwintherCommit Queue
authored andcommitted
[cfe] Use last token for missing constructor error
Change-Id: I1ae241eac162b9b0048a7e8ecbd9a9ddfe268d12 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408560 Reviewed-by: Chloe Stefantsova <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent 4c0121f commit 2c81261

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

pkg/front_end/lib/src/kernel/body_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6421,7 +6421,7 @@ class BodyBuilder extends StackListenerImpl
64216421
typeName = type.fullNameForErrors;
64226422
}
64236423
push(buildUnresolvedError(
6424-
debugName(typeName!, name), nameToken.charOffset,
6424+
debugName(typeName!, name), nameLastToken.charOffset,
64256425
arguments: arguments, kind: UnresolvedKind.Constructor));
64266426
}
64276427
constantContext = savedConstantContext;

pkg/front_end/testcases/general/issue37776.dart.strong.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ library;
99
// class X {
1010
// ^
1111
//
12-
// pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
12+
// pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
1313
// const X.foo();
14-
// ^^^
14+
// ^^^
1515
//
1616
import self as self;
1717
import "dart:core" as core;
@@ -27,7 +27,7 @@ class X extends core::Object /*hasConstConstructor*/ {
2727
;
2828
}
2929
static method main() → void {
30-
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
30+
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
3131
const X.foo();
32-
^^^";
32+
^^^";
3333
}

pkg/front_end/testcases/general/issue37776.dart.strong.modular.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ library;
99
// class X {
1010
// ^
1111
//
12-
// pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
12+
// pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
1313
// const X.foo();
14-
// ^^^
14+
// ^^^
1515
//
1616
import self as self;
1717
import "dart:core" as core;
@@ -27,7 +27,7 @@ class X extends core::Object /*hasConstConstructor*/ {
2727
;
2828
}
2929
static method main() → void {
30-
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
30+
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
3131
const X.foo();
32-
^^^";
32+
^^^";
3333
}

pkg/front_end/testcases/general/issue37776.dart.strong.transformed.expect

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ library;
99
// class X {
1010
// ^
1111
//
12-
// pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
12+
// pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
1313
// const X.foo();
14-
// ^^^
14+
// ^^^
1515
//
1616
import self as self;
1717
import "dart:core" as core;
@@ -27,7 +27,7 @@ class X extends core::Object /*hasConstConstructor*/ {
2727
;
2828
}
2929
static method main() → void {
30-
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:9: Error: Couldn't find constructor 'X.foo'.
30+
invalid-expression "pkg/front_end/testcases/general/issue37776.dart:16:11: Error: Couldn't find constructor 'X.foo'.
3131
const X.foo();
32-
^^^";
32+
^^^";
3333
}

0 commit comments

Comments
 (0)