Dart2Js Mirrors throws exception when unrelated library is imported #19173

Closed
kevmoo opened this Issue Jun 3, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@kevmoo
Member

kevmoo commented Jun 3, 2014

The case:

Package A:
  define library X
  define library Y, exports X

Package B:
  define library Z, exports A.Y

Package C:
  Import library B.Z
  Try the following:

import 'dart:mirrors';
import 'package:B/Z.dart';

void main() {
  ClassMirror typeMirror = reflectType(Bar);
  var decs = typeMirror.declarations;
}

class Bar {
  int a;
}

Results in a crash, but only in Dart2JS + Checked Mode

@kevmoo

This comment has been minimized.

Show comment Hide comment
@kevmoo

kevmoo Jun 3, 2014

Member

I have a test that reproduces this issue, but it's far from minimal

https://codereview.chromium.org/312713003/

It does not seem relate to exports as I originally guessed


Changed the title to: "Dart2Js Mirrors throws exception when unrelated library is imported".

Member

kevmoo commented Jun 3, 2014

I have a test that reproduces this issue, but it's far from minimal

https://codereview.chromium.org/312713003/

It does not seem relate to exports as I originally guessed


Changed the title to: "Dart2Js Mirrors throws exception when unrelated library is imported".

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Jun 4, 2014

Here is an even smaller example:

import 'dart:mirrors';

class A {
  const A();
}

@deprecated
const A anA = const A();

main() {
  ClassMirror typeMirror = reflectType(A);
  var decs = typeMirror.declarations;
  print(decs.length);
}

The issue is that the mirrors implementation cannot handle metadata in library descriptors. Unfortunately, I have no time left to fix this right now.

ghost commented Jun 4, 2014

Here is an even smaller example:

import 'dart:mirrors';

class A {
  const A();
}

@deprecated
const A anA = const A();

main() {
  ClassMirror typeMirror = reflectType(A);
  var decs = typeMirror.declarations;
  print(decs.length);
}

The issue is that the mirrors implementation cannot handle metadata in library descriptors. Unfortunately, I have no time left to fix this right now.

@dgrove

This comment has been minimized.

Show comment Hide comment
@dgrove

dgrove Jun 6, 2014

Member

Added C1 label.

Member

dgrove commented Jun 6, 2014

Added C1 label.

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Jun 10, 2014

See https://codereview.chromium.org/328803002/ for a proposed fix.


Set owner to @herhut-ggl.
Added Started label.

ghost commented Jun 10, 2014

See https://codereview.chromium.org/328803002/ for a proposed fix.


Set owner to @herhut-ggl.
Added Started label.

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Jun 12, 2014

Fixed as of revision r37256.


Added Fixed label.

ghost commented Jun 12, 2014

Fixed as of revision r37256.


Added Fixed label.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment