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

charptr fix

This commit is contained in:
Alexander Medvednikov 2019-12-01 10:11:05 +03:00
parent 0999273d32
commit 698c3823ee

View File

@ -640,6 +640,12 @@ fn (p mut Parser) check_types2(got_, expected_ string, throw bool) bool {
if got=='byte*' && expected=='byteptr' {
return true
}
if got=='charptr' && expected=='char*' {
return true
}
if got=='char*' && expected=='charptr' {
return true
}
if got=='int' && expected=='byte*' {
return true
}
@ -647,7 +653,7 @@ fn (p mut Parser) check_types2(got_, expected_ string, throw bool) bool {
//return true
//}
// byteptr += int
if got=='int' && expected=='byteptr' {
if got=='int' && expected in ['byteptr', 'charptr'] {
return true
}
if got == 'Option' && expected.starts_with('Option_') {