-
-
Save jakemac53/98a056538de10e1ac7f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library index; | |
import 'package:reflectable/reflectable.dart'; | |
class MyReflectable extends Reflectable { | |
const MyReflectable() : super(instanceInvokeCapability); | |
} | |
const myReflectable = const MyReflectable(); | |
@myReflectable | |
class MyClass { | |
String get $ => 'hello'; | |
} | |
main() { | |
var instance = new MyClass(); | |
var mirror = myReflectable.reflect(instance); | |
print(mirror.invokeGetter(r'$')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building playground... (6.1s) | |
[Info from Dart2JS]: | |
Compiling playground|web/reflectable/index.dart... | |
[Error from Dart2JS on playground|web/reflectable/index.dart]: | |
web/reflectable/index_reflection_data.dart:14:223: | |
A '$' has special meaning inside a string, and must be followed by an identifier or an expression in curly braces ({}). | |
Try adding a backslash (\) to escape the '$'. | |
r.data = {const prefix0.MyReflectable(): new r.ReflectorData([new r.ClassMirrorImpl("MyClass", "index.MyClass", 0, const prefix0.MyReflectable(), [0], [1, 2, 3, 4, 5, 0], -1, {}, {}, {}, null)], [new r.MethodMirrorImpl("$", 3, 0, const prefix0.MyReflectable(), null), new r.MethodMirrorImpl("==", 2, null, const prefix0.MyReflectable(), null), new r.MethodMirrorImpl("toString", 2, null, const prefix0.MyReflectable(), null), new r.MethodMirrorImpl("noSuchMethod", 2, null, const prefix0.MyReflectable(), null), new r.MethodMirrorImpl("hashCode", 3, null, const prefix0.MyReflectable(), null), new r.MethodMirrorImpl("runtimeType", 3, null, const prefix0.MyReflectable(), null)], [prefix0.MyClass], {"==": (dynamic instance) => (x) => instance == x, "toString": (dynamic instance) => instance.toString, "noSuchMethod": (dynamic instance) => instance.noSuchMethod, "hashCode": (dynamic instance) => instance.hashCode, "runtimeType": (dynamic instance) => instance.runtimeType, "$": (dynamic instance) => instance.$}, {})}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: repro | |
dependencies: | |
reflectable: | |
path: ../reflectable/reflectable | |
transformers: | |
- reflectable: | |
entry_points: | |
- web/index.dart | |
- $dart2js: | |
$include: | |
- web/index.dart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment