Discussion:
[dart-misc] mirror changes in 1.12??
Anders Holmgren
2015-08-12 22:13:08 UTC
Permalink
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)
--
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+***@dartlang.org.
'Gilad Bracha' via Dart Misc
2015-08-12 23:34:01 UTC
Permalink
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.
Post by Anders Holmgren
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
Uncaught Error: The null object does not have a getter 'simpleName'.
NoSuchMethodError: method not found: 'simpleName'
Receiver: null
Arguments: []
#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)
--
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
--
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+***@dartlang.org.
Loading...