Skip to content

Type inference for generators #4309

@DustinByfuglien

Description

@DustinByfuglien
#![feature(generators)]

fn main() {
    let x = || { yield 3 };
}

When using VSCode with this code I notice that:

  1. It seems a yield with argument is reported by analyzer as error.
  2. Also helping hint about x type displays that x have closure type || -> i32 instead of generator trait type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions