error: else expression without matching if
000035b: error: OnElseExpr callback failed

but if I use [[eosio::on_notify("eosio.token::transfer")]], compilation is success

解决

升级 eosio.cdt v1.6.2+

参考

https://github.com/EOSIO/eosio.cdt/issues/497
https://github.com/EOSIO/eosio.cdt/blob/796ff8bee9a0fc864f665a0a4d018e0ff18ac383/tests/unit/test_contracts/simple_tests.cpp
https://github.com/EOSIO/eosio.cdt/blob/796ff8bee9a0fc864f665a0a4d018e0ff18ac383/docs/upgrading/1.5-to-1.6.md