mirror changes in 1.12??

65 views
Skip to first unread message

Anders Holmgren

unread,
Aug 12, 2015, 6:13:08 PM8/12/15
to Dart Misc
Just noticed something blow up in 1.12 that I haven't seen before. I get a TypeMirror without an owner. Should this be possible?

My crude method is

bool isSimpleType(TypeMirror tm) =>
(tm.isTopLevel && tm.owner.simpleName == #dart.core);


The exception is

Unhandled exception:
Uncaught Error: The null object does not have a getter 'simpleName'.

NoSuchMethodError: method not found: 'simpleName'
Receiver: null
Arguments: []
Stack Trace:
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 isSimpleType (package:shelf_bind/src/util/mirror_util.dart:55:32)

Gilad Bracha

unread,
Aug 12, 2015, 7:34:16 PM8/12/15
to Dart Misc
A TypeMirror should always have an owner. I can't tell whether tm really was a TypeMirror though. The owner should only be null for LibraryMirrors. If tm is a TypeMirror, please file a bug.

--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new

To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Reply all
Reply to author
Forward
0 new messages