syntax-errorcrystal-lang

"Error: unterminated parenthesized expression" when using function of object after parenthesis


i'm running into the problem:

Error: unterminated parenthesized expression when trying to compile:

expiry_epoch = (expiry_date_bytes.pointer(expiry_date_bytes.size) as Int64*).value

I'm not that comfortable with crystal so i'm better off asking.

The only fix in my mind is:

expiry_epoch = expiry_date_bytes.pointer(expiry_date_bytes.size) as Int64*
expiry_epoch = expiry_epoch.value

Thanks in advance!


Solution

  • That as syntax is very old and effectively obsolete by now.

    You can write expiry_date_bytes.pointer(expiry_date_bytes.size).as(Int64*).value