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

ui: Objective-C @interface support for Cocoa; minor clean-ups

This commit is contained in:
Alexander Medvednikov
2019-09-21 21:38:12 +03:00
parent fbc19311b5
commit bf1ee28194
11 changed files with 112 additions and 89 deletions

View File

@ -54,6 +54,7 @@ enum TypeCategory {
union_ // 5
c_struct
c_typedef
objc_interface // 8 Objective C @interface
array
}
@ -607,6 +608,11 @@ fn (p mut Parser) _check_types(got_, expected_ string, throw bool) bool {
// if expected == 'T' || expected.contains('<T>') {
// return true
// }
// TODO fn hack
if got.starts_with('fn ') && (expected.ends_with('fn') ||
expected.ends_with('Fn')) {
return true
}
// Allow pointer arithmetic
if expected=='void*' && got=='int' {
return true