Skip to content

Higher-order generic functions disobey kind system #1037

Closed
@brson

Description

@brson
fn spawn2<@T>(x: T, f: fn(T))  {
    f(x);
}

fn main() {
    fn foo<~T>(x: T) {
        log_err x;
    }

    spawn2::<@int>(@10, foo);
}

spawn2 is passing a shared kind to a function that only takes unique kinds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions