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

cgen: allow using of original operation if alias is number and no custom method is defined (#17718)

This commit is contained in:
Swastik Baranwal
2023-03-21 15:09:58 +05:30
committed by GitHub
parent 326e43385b
commit 93b7cc4888
2 changed files with 15 additions and 0 deletions

View File

@@ -286,3 +286,9 @@ fn test_add_seconds_to_time() {
future_tm := now_tm.add_seconds(60)
assert now_tm.unix < future_tm.unix
}
fn test_plus_equals_duration() {
mut d := time.second
d += time.second
assert d == 2 * time.second
}