CSharpRepl icon indicating copy to clipboard operation
CSharpRepl copied to clipboard

Bugged Memory<T> output

Open Emik03 opened this issue 1 year ago • 0 comments

Version

0.6.5

What happened?

A non-default Memory<T> doesn't produce the correct output on detailed mode.

Expected

Displays .ToString() properly, such as...

> "foobar".AsMemory()[3..]
"bar"
└── 🟡 Length: 3

Actual

> "foobar".AsMemory()[3..]
!<Member 'ToString(),raw' not found>
├── 🟡 IsFixedSize: true
├── 🟡 IsReadOnly: false
├── 🟡 IsSynchronized: false
├── 🟡 Length: 3
├── 🟡 LongLength: 3
├── 🟡 Rank: 1
└── 🟡 SyncRoot: char[3]
    ┌──────┬───────┬──────┐
    │ Name │ Value │ Type │
    ├──────┼───────┼──────┤
    │ [0]  │ 'b'   │ char │
    │ [1]  │ 'a'   │ char │
    │ [2]  │ 'r'   │ char │
    └──────┴───────┴──────┘

> 

Workaround

Adding a .ToString() or .ToArray() solves this issue.

> "foobar".AsMemory()[3..].ToString()
bar
└── 🟡 Length: 3

Emik03 avatar Nov 13 '23 01:11 Emik03