Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dart2Js Mirrors throws exception when unrelated library is imported #19173

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

Dart2Js Mirrors throws exception when unrelated library is imported #19173

kevmoo opened this issue Jun 3, 2014 · 5 comments

Comments

@kevmoo
Copy link
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
Copy link
Member Author

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
Copy link

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
Copy link
Contributor

dgrove commented Jun 6, 2014

Added C1 label.

@ghost
Copy link

ghost commented Jun 10, 2014

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


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

@ghost
Copy link

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
Projects
None yet
Development

No branches or pull requests

2 participants