Skip to content

Single-element vec / str append. #44

Closed
@graydon

Description

@graydon

This might involve digging in the typechecker a bit; it'd be good for these to
work:

let vec[T] v = ...;
let T t = ...;
v += t;

and

let str s = "hi";
s += 'x';

At the moment both the typechecker and the backend prefer to think of operator

  • as only applying to identical-typed values. Which is usually good. This is
    just an exceptional case that might be good to provide support for.

For the time being we can fake it using a single-element temporary vec or a
single-char string. It's just kinda lame. But this is a lower-priority bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions