v icon indicating copy to clipboard operation
v copied to clipboard

`rune` instances are not printable

Open Undumendil opened this issue 7 years ago • 3 comments

Input:

fn main(){
    a := rune('1')
    println(a)
}

Expected output: 1 Output:

`rune` needs to have method `str() string` to be printable

Undumendil avatar Jun 20 '19 12:06 Undumendil

Even without printing, the assignment gives a compile error:

/home/bowero//.vlang//test.c:3585:27: error: operand of type 'string' (aka 'struct string') where arithmetic or pointer type is required
rune a= (/*casttt*/ (rune)( /*77*/ tos2("1") ) ) ;

Bowero avatar Jun 26 '19 20:06 Bowero

This issue is closed. Can it be moved to completed in the kanban?

RiordanIX avatar Aug 06 '19 16:08 RiordanIX

@RiordanIX Done.

chanbakjsd avatar Sep 28 '19 07:09 chanbakjsd