Skip to content

Couldn't infer type parameter 'N extends Built<N, NB>'. #127

@Jorgezz

Description

@Jorgezz

error: Couldn't infer type parameter 'N extends Built<N, NB>'.

Tried to infer 'AppState' for 'N extends Built<N, NB>' which doesn't work:
Type parameter 'N extends Built<N, NB>' declared to extend 'Built<AppState, NB extends Builder<N, NB>>'.
The type 'AppState' was inferred from:
Parameter 'nested' declared as 'NestedReducerBuilder<AppState, AppStateBuilder, N, NB>'
but argument is 'NestedReducerBuilder<AppState, AppStateBuilder, AppState, AppStateBuilder>'.

Consider passing explicit type argument(s) to the generic.

(could_not_infer at [xxx] lib/engine/app_reducers.dart:35)

code:
final appReducerBuilder = ReducerBuilder<AppState, AppStateBuilder>()
..combineNested(aReducerBuilder) etc...

final debugReducerBuilder = NestedReducerBuilder<AppState, AppStateBuilder,
DebugState, DebugStateBuilder>((s) => s.debugState, (b) => b.debugState)
..add(DebugActionsNames.toggleShowPerformanceOverlayAction,
_toggleShowPerformanceOverlay)
..add(DebugActionsNames.toggleStaggeredTileUseFit,
_toggleStaggeredTileUseExtent)
..add(DebugActionsNames.toggleApiEnvironment, _toggleTestEnvironment)
..add(DebugActionsNames.toggleMotiveDetectorDebug, _toggleMotionDetectorDebug);

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