+
Skip to content

Type Mismatch when mocking Command with Result type return value. #8

@Gaby-Torres

Description

@Gaby-Torres

When mocking a command with Result return value, a type mismatch error is thrown:

The following _TypeError was thrown while running async test code:
type 'MockCommand<double, ResultDart<void, Exception>>' is not a subtype of type 'Command<double,
ResultDart<void, Exception>>' in type cast

Code:

//This Mocks Properly
Command<double, void> setFoo = MockCommand<double, void>(
  initialValue: null,
  noReturnValue: true,
);

//This does not
Command<double, Result<void>> updateFoo =
    MockCommand<double, Result<void>>(
      initialValue: Success(()),
      noReturnValue: false,
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载