Skip to content

Commit

Permalink
1.change DirectMethodInvocation to MethodInvocation;
Browse files Browse the repository at this point in the history
2.add "node.nullability";
  • Loading branch information
fightcoder authored and kangwang1988 committed Nov 14, 2020
1 parent dcc980b commit 90fb874
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/transformer/aop/aop_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class AopUtils {
return const DynamicType();
}
return TypeParameterType(
deepCopyASTNode(node.parameter), deepCopyASTNode(node.promotedBound));
deepCopyASTNode(node.parameter), node.nullability,deepCopyASTNode(node.promotedBound));
}
if (node is FunctionType) {
return FunctionType(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/transformer/aop/aspectd_aop_call_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ class AspectdAopCallVisitor extends Transformer {
Class pointCutClass, Class procedureImpl, Procedure originalProcedure) {
//Add library dependency
//Add new Procedure
final DirectMethodInvocation mockedInvocation = DirectMethodInvocation(
final MethodInvocation mockedInvocation = MethodInvocation(
AsExpression(PropertyGet(ThisExpression(), Name('target')),
InterfaceType(procedureImpl, Nullability.legacy)),
originalProcedure,
originalProcedure.name,
AopUtils.concatArguments4PointcutStubCall(originalProcedure));
final bool shouldReturn =
!(originalProcedure.function.returnType is VoidType);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/transformer/aop/aspectd_aop_execute_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ class AspectdAopExecuteVisitor extends RecursiveVisitor<void> {
final Class pointcutClass = AopUtils.pointCutProceedProcedure.parent;
AopUtils.insertLibraryDependency(pointcutLibrary, originalLibrary);

final DirectMethodInvocation mockedInvocation = DirectMethodInvocation(
final MethodInvocation mockedInvocation = MethodInvocation(
AsExpression(PropertyGet(ThisExpression(), Name('target')),
InterfaceType(originalClass, Nullability.legacy)),
originalStubProcedure,
originalStubProcedure.name,
AopUtils.concatArguments4PointcutStubCall(originalProcedure));

final Procedure stubProcedureNew = AopUtils.createStubProcedure(
Expand Down

0 comments on commit 90fb874

Please sign in to comment.