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

checker: cleanup obsolete code for compatibility between byteptr and &byte (#16494)

This commit is contained in:
Delyan Angelov 2022-11-20 16:44:58 +02:00 committed by GitHub
parent cb336c7dc7
commit 0e727ec50a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,18 +219,6 @@ pub fn (mut c Checker) check_expected_call_arg(got ast.Type, expected_ ast.Type,
idx_expected := expected.idx()
if idx_got in [ast.byteptr_type_idx, ast.charptr_type_idx]
|| idx_expected in [ast.byteptr_type_idx, ast.charptr_type_idx] {
igot := int(got)
iexpected := int(expected)
// TODO: remove; transitional compatibility for byteptr === &byte
if (igot == ast.byteptr_type_idx && iexpected == 65545)
|| (iexpected == ast.byteptr_type_idx && igot == 65545) {
return
}
// TODO: remove; transitional compatibility for charptr === &char
if (igot == ast.charptr_type_idx && iexpected == 65551)
|| (iexpected == ast.charptr_type_idx && igot == 65551) {
return
}
muls_got := got.nr_muls()
muls_expected := expected.nr_muls()
if idx_got == ast.byteptr_type_idx && idx_expected == ast.u8_type_idx