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

Constructors that have generics type Call hook fail #89

Closed
ameryzhu opened this issue Jan 7, 2021 · 2 comments
Closed

Constructors that have generics type Call hook fail #89

ameryzhu opened this issue Jan 7, 2021 · 2 comments

Comments

@ameryzhu
Copy link

ameryzhu commented Jan 7, 2021

@call("package:xxx_flutter_xxx/xxx/date_picker.dart",
"PickerComponent", "+PickerComponent")
@pragma("vm:entry-point")
static dynamic PickerComponentHook0(PointCut pointcut) {
print('[aspectd]: PickerComponent constructor0 is call!');
return pointcut.proceed();
}

class PickerComponent extends StatefulWidget {
final T pickerModel;
final int columnCount;
final bool showTitleActions;
final OnChangedCallback onChanged;
final OnChangedCallback onConfirm;
final OnChangedCallback onCancel;

const PickerComponent({
Key key,
this.pickerModel,
this.columnCount,
this.showTitleActions,
this.onChanged,
this.onConfirm,
this.onCancel,
}) : super(key: key);

@OverRide
State createState() {
return _PickerComponentState();
}
}

Unhandled exception:
Invalid argument(s): Type parameter TypeParameter(PickerComponent.T) is not indexed
#0 TypeParameterIndexer.[] (package:kernel/binary/ast_to_binary.dart:2628:8)
#1 BinaryPrinter.visitTypeParameterType (package:kernel/binary/ast_to_binary.dart:2180:38)
#2 TypeParameterType.accept (package:kernel/ast.dart:8204:42)
#3 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#4 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:292:7)
#5 BinaryPrinter.visitFunctionType (package:kernel/binary/ast_to_binary.dart:2160:7)
#6 FunctionType.accept (package:kernel/ast.dart:7653:42)
#7 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#8 BinaryPrinter.visitAsExpression (package:kernel/binary/ast_to_binary.dart:1647:5)
#9 AsExpression.accept (package:kernel/ast.dart:4963:44)
#10 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#11 BinaryPrinter.visitNamedExpression (package:kernel/binary/ast_to_binary.dart:1534:5)
#12 NamedExpression.accept (package:kernel/ast.dart:3863:38)
#13 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#14 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:292:7)
#15 BinaryPrinter.visitArguments (package:kernel/binary/ast_to_binary.dart:1528:5)
#16 Arguments.accept (package:kernel/ast.dart:3803:38)
#17 BinaryPrinter.writeArgumentsNode (package:kernel/binary/ast_to_binary.dart:396:10)
#18 BinaryPrinter.visitConstructorInvocation (package:kernel/binary/ast_to_binary.dart:1520:5)
#19 ConstructorInvocation.accept (package:kernel/ast.dart:4204:44)
#20 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#21 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:475:7)
#22 BinaryPrinter.visitReturnStatement (package:kernel/binary/ast_to_binary.dart:1975:5)
#23 ReturnStatement.accept (package:kernel/ast.dart:6541:43)
#24 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#25 BinaryPrinter.writeNodeList (package:kernel/binary/ast_to_binary.dart:292:7)
#26 BinaryPrinter.visitBlock (package:kernel/binary/ast_to_binary.dart:1834:5)
#27 Block.accept (package:kernel/ast.dart:5873:43)
#28 BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:382:10)
#29 BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:475:7)
#30 BinaryPrinter.visitFunctionNode (package:kernel/binary/ast_to_binary.dart:1358:5)
#31 FunctionNode.accept (package:kernel/ast.dart:2932:38)
#32 BinaryPrinter.writeFunctionNode (package:kernel/binary/ast_to_binary.dart:389:10)
#33 BinaryPrinter.writeOptionalFunctionNode (package:kernel/binary/ast_to_binary.dart:484:7)
#34 BinaryPrinter.visitProcedure (package:kernel/binary/ast_to_binary.dart:1234:5)
#35 Procedure.accept (package:kernel/ast.dart:2423:40)
#36 BinaryPrinter.writeProcedureNode (package:kernel/binary/ast_to_binary.dart:410:10)
#37 BinaryPrinter.writeProcedureNodeList (package:kernel/binary/ast_to_binary.dart:301:7)
#38 BinaryPrinter.visitClass (package:kernel/binary/ast_to_binary.dart:1143:5)
#39 Class.accept (package:kernel/ast.dart:1379:38)
#40 BinaryPrinter.writeClassNode (package:kernel/binary/ast_to_binary.dart:424:10)
#41 BinaryPrinter.writeClassNodeList (package:kernel/binary/ast_to_binary.dart:319:7)
#42 BinaryPrinter.visitLibrary (package:kernel/binary/ast_to_binary.dart:973:5)
#43 Library.accept (package:kernel/ast.dart:607:38)
#44 BinaryPrinter.writeLibraryNode (package:kernel/binary/ast_to_binary.dart:403:10)
#45 BinaryPrinter.writeLibraries (package:kernel/binary/ast_to_binary.dart:710:9)
#46 BinaryPrinter.writeComponentFile. (package:kernel/binary/ast_to_binary.dart:553:7)
#47 Timeline.timeSync (dart:developer/timeline.dart:163:22)
#48 BinaryPrinter.writeComponentFile (package:kernel/binary/ast_to_binary.dart:536:14)
#49 FrontendCompiler.writeDillFile (package:frontend_server/frontend_server.dart:751:15)
#50 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:562:13)

#51 _FlutterFrontendCompiler.compile (file:///Users/local-admin/Documents/sfcode/load_module/fs-base-ios-flutter-foundation/sfim-flutter-aspectd/lib/src/flutter_frontend_server/server.dart:52:22)
#52 starter (file:///Users/local-admin/Documents/sfcode/load_module/fs-base-ios-flutter-foundation/sfim-flutter-aspectd/lib/src/flutter_frontend_server/server.dart:191:27)
#53 main (file:///Users/local-admin/Documents/sfcode/load_module/fs-base-ios-flutter-foundation/sfim-flutter-aspectd/lib/src/flutter_frontend_server/starter.dart:13:30)
#54 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

@kangwang1988
Copy link
Contributor

给一个完整的例子。

@kangwang1988
Copy link
Contributor

Read DEBUG.md for more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants