Skip to content

Improve warning for ignored values in sequence expressions #4228

@forki

Description

@forki
// stupid things to make the sample compile
let div _ _ = 1  
let subView _ _ = [1; 2]

// elmish view
let view model dispatch =
   [
       yield! subView model dispatch
       div [] [] // <- warning
       div [] [] // <- warning
   ]

This code gives famous the famous "The result of this expression is implicitly ignored" message and suggests to bind to a let binding. This is wrong advice and not helpful for newcomers in elmish apps.

Instead we should improve the warning when we are inside of list comprehsions to something more useful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions