Skip to content

Generic Test references VM specific hidden fields #1959

Closed
@DartBot

Description

@DartBot

This issue was originally filed by zundel@google.com


tests/language/src/GenericTest.dart

Its trying to determine the line number of the place where the error
was thrown, but the field being used is VM specific.

file:/home/zundel/dart/tests/language/src/GenericTest.dart:30: C.T is not assignable to A
    29: class C<T> {
    30: B<T> b_;
file:/home/zundel/dart/tests/language/src/GenericTest.dart:31: C.T is not assignable to A
    30: B<T> b_;
    31: C(T t) : b_ = new B<T>(t) { }
file:/home/zundel/dart/tests/language/src/GenericTest.dart:64: "dstName" is not a member of TypeError
    63: Expect.equals("AX", error.srcType);
    64: Expect.equals("a_", error.dstName);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:65: "url" is not a member of TypeError
    64: Expect.equals("a_", error.dstName);
    65: int pos = error.url.lastIndexOf("/", error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:65: "url" is not a member of TypeError
    64: Expect.equals("a_", error.dstName);
    65: int pos = error.url.lastIndexOf("/", error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:67: "url" is not a member of TypeError
    66: if (pos == -1) {
    67: pos = error.url.lastIndexOf("&quot;, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:67: "url" is not a member of TypeError
    66: if (pos == -1) {
    67: pos = error.url.lastIndexOf("&quot;, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:69: "url" is not a member of TypeError
    68: }
    69: String subs = error.url.substring(pos + 1, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:69: "url" is not a member of TypeError
    68: }
    69: String subs = error.url.substring(pos + 1, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:71: "line" is not a member of TypeError
    70: Expect.equals("GenericTest.dart", subs);
    71: Expect.equals(23, error.line);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:72: "column" is not a member of TypeError
    71: Expect.equals(23, error.line);
    72: Expect.equals(23, error.column);
zundel@santafe(analysis-batch-3):/dart$ ./tools/test.py --component dartc tests/language/src/GenericTest.dart
zundel@santafe(analysis-batch-3):
/dart$ ./tools/test.py --component dartc language/GenericTest.dart
[00:01 | 100% | + 1 | - 0]

zundel@santafe(analysis-batch-3):~/dart$ frog tests/language/src/GenericTest.dart
tests/language/src/GenericTest.dart:64:27: warning: cannot find "dstName" on "TypeError"
      Expect.equals("a_", error.dstName);
                          ^^^^^^^^^^^^^
tests/language/src/GenericTest.dart:20:9: warning: type AX is not a subtype of A
class B<T extends A> {
        ^^^^^^^^^^^
/tmp/tmpA40rVy/out.js:14: Expect.equals(expected: <1>, actual: <0>) fails.
  throw e;

file:/home/zundel/dart/tests/language/src/GenericTest.dart:64: "dstName" is not a member of TypeError
    63: Expect.equals("AX", error.srcType);
    64: Expect.equals("a_", error.dstName);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:65: "url" is not a member of TypeError
    64: Expect.equals("a_", error.dstName);
    65: int pos = error.url.lastIndexOf("/", error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:65: "url" is not a member of TypeError
    64: Expect.equals("a_", error.dstName);
    65: int pos = error.url.lastIndexOf("/", error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:67: "url" is not a member of TypeError
    66: if (pos == -1) {
    67: pos = error.url.lastIndexOf("&quot;, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:67: "url" is not a member of TypeError
    66: if (pos == -1) {
    67: pos = error.url.lastIndexOf("&quot;, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:69: "url" is not a member of TypeError
    68: }
    69: String subs = error.url.substring(pos + 1, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:69: "url" is not a member of TypeError
    68: }
    69: String subs = error.url.substring(pos + 1, error.url.length);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:71: "line" is not a member of TypeError
    70: Expect.equals("GenericTest.dart", subs);
    71: Expect.equals(23, error.line);
file:/home/zundel/dart/tests/language/src/GenericTest.dart:72: "column" is not a member of TypeError
    71: Expect.equals(23, error.line);
    72: Expect.equals(23, error.column);

I don't think Frog has a chance of passing this test. Can it be moved to a Vm specific dir?

zundel@santafe(analysis-batch-3):~/dart$ frog tests/language/src/GenericTest.dart
tests/language/src/GenericTest.dart:64:27: warning: cannot find "dstName" on "TypeError"
      Expect.equals("a_", error.dstName);
                          ^^^^^^^^^^^^^
tests/language/src/GenericTest.dart:20:9: warning: type AX is not a subtype of A
class B<T extends A> {
        ^^^^^^^^^^^
/tmp/tmpA40rVy/out.js:14: Expect.equals(expected: <1>, actual: <0>) fails.
  throw e;
        ^
Expect.equals(expected: <1>, actual: <0>) fails.
    at Function._fail (/tmp/tmpA40rVy/out.js:178:3)
    at Function.equals (/tmp/tmpA40rVy/out.js:172:10)
    at Function.testMain (/tmp/tmpA40rVy/out.js:642:10)
    at main (/tmp/tmpA40rVy/out.js:646:15)
    at /tmp/tmpA40rVy/out.js:656:1

(If we fix the test and put @­static-clean on this test, we should get a failure from the analyzer if this were to happen again)

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions