1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963)

This commit is contained in:
Alexander Ivanov
2021-10-11 15:41:31 +03:00
committed by GitHub
parent d0c961ebc0
commit 0386f2bbea
40 changed files with 219 additions and 92 deletions

View File

@ -3,6 +3,7 @@ module io
// ReaderWriter represents a stream that can be read from and wrote to
pub interface ReaderWriter {
// from Reader
mut:
read(mut buf []byte) ?int
// from Writer
write(buf []byte) ?int
@ -11,8 +12,8 @@ pub interface ReaderWriter {
// ReaderWriterImpl is a ReaderWriter that can be made from
// a seperate reader and writer (see fn make_readerwriter)
struct ReaderWriterImpl {
r Reader
mut:
r Reader
w Writer
}