Skip to content

Does the return of a template function have template phase? #3477

Open
@josh11b

Description

@josh11b

Summary of issue:

#2153 does not address whether the return type of a template function has template phase

Details:

Interesting examples:

fn TemplateIdentity[template T:! type](x: T) -> T { return x; } 
fn Caller[T:! I](x: T) {
  // Does the type of `y` have template phase or is its type precisely `T`?
  let y: auto = TemplateIdentity(x);
}

// Do we want a generic caller to need a constraint that ensures `T.U` is defined to call this function?
fn TemplateNonIdentity[template T:! type](x: T) -> T.U { return x.F(); } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    leads questionA question for the leads team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions