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

VariableMirror.type of Queue throws TypeError #16070

Closed
DartBot opened this issue Jan 13, 2014 · 2 comments
Closed

VariableMirror.type of Queue throws TypeError #16070

DartBot opened this issue Jan 13, 2014 · 2 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-not-planned Closed as we don't intend to take action on the reported issue library-mirrors type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jan 13, 2014

This issue was originally filed by @denniskaselow


What steps will reproduce the problem?
Run this code as javascript:

import 'dart:html';
import 'dart:collection';

@MirrorsUsed(targets: const [A])
import 'dart:mirrors';

void main() {
  var cm = reflectClass(A);
  cm.declarations.values.where((d) => d is VariableMirror)
                        .forEach((vm) => print(vm.type));
}

class A {
  B foo;
  List<int> bar;
  Queue<int> foobar;
}

class B {}

What is the expected output? What do you see instead?
Running this as javascript gives following output in chrome:

TypeMirror on 'dynamic'
ClassMirror on 'List'
Uncaught TypeError: Cannot read property 'builtin$cls' of undefined

I would expect
TypeMirror on 'dynamic'
for the Queue.

What version of the product are you using? On what operating system?
Dart Editor version 1.1.0.dev_05_06 (DEV)
Dart SDK version 1.1.0-dev.5.6

Please provide any additional information below.
If I add Queue to the list of targets in MirrorsUsed it works and outputs ClassMirror on 'Queue'. But I would be fine if it would just output TypeMirror on 'dynamic' like it does for B. So far, Queue is the only class that I've run into that produces this error.

@lrhn
Copy link
Member

lrhn commented Jan 14, 2014

Added Library-Mirrors, Area-Library, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jan 14, 2014

This comment was originally written by @denniskaselow


One more bit of information. I just realized Queue isn't the reason that this fails, but using a type argument in the declaration. If I just write

Queue foobar;

It works too, but if I do this

class A {
  B<int> foo;
  List<int> bar;
  Queue foobar;
}

class B<T> {}

it'll fail when trying to get the type of foo.

@DartBot DartBot added Type-Defect library-mirrors area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Jan 14, 2014
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@a-siva a-siva added closed-as-intended Closed as the reported issue is expected behavior closed-not-planned Closed as we don't intend to take action on the reported issue and removed closed-as-intended Closed as the reported issue is expected behavior labels Aug 5, 2022
@a-siva a-siva closed this as completed Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-not-planned Closed as we don't intend to take action on the reported issue library-mirrors type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants