Closed malthe closed 2 years ago
Which version of webapi are you using?
[edit] I can see these @as lines are there in the current code… this compiles just fine for everyone using a ReScript release though. Why are you using one you compiled yourself? Are you able to try a release version to confirm?
This might be something that’s changing in ReScript 10, which would be good to know.
I have also tried ReScript 9.1.4. Same result. This is both the latest release and I have tried master branch as well.
Might it have to do with the OCaml release?
ReScript shouldn’t change based on the OCaml release it’s compiled with.
I’m very interested in solving compatibility problems like this but I (and others) have been using webapi with 9.1.4 for months.
I wonder if something else about your project is causing this. Are you able to share (or build) a replication case?
Seems to be related to this: https://forum.rescript-lang.org/t/string-literal-syntax/2821.
I must have made some mistake because I intended to be on 9.1.4 and not master; what I had sought for was to compile my own rescript with a more recent OCaml, i.e., 4.10.2+rescript and so I was building the rescript compiler from source.
OK, so this might be a ReScript 10 incompatibility. It could still be reverted as a mistake; I will wait until the change is available in an official pre-release build before making any adjustments. I will open a new ticket at that time.
Compiling ReScript with a newer OCaml should make no difference to the compiler itself, other than making it faster on Apple Silicon computers. I suggest sticking with the 9.1.4 release for now (or there is a pre-release v10 build if you really want faster M1 support).
Oh it wasn't really speed I was looking for, but just compatibility with other parts of the OCaml toolchain.
ah, using a newer OCaml compiler won't help with that either. The ReScript compiler is based on OCaml 4.06 semantics and they have shown little interest in upgrading it.
If you'd like better compatibility with OCaml try melange. It's a fork of ReScript from back when it was called BuckleScript, upgraded with all the latest OCaml features (and it tries to keep up to date with ReScript features too).
I'll check that out thanks. By the way, I do think they are somewhat committed to a newer version since they published https://opam.ocaml.org/packages/ocaml-variants/ocaml-variants.4.10.2+rescript/.
They are committed to compiling ReScript on a newer ocaml version. That doesn’t mean they will adopt any of the language changes, just that it helps them stay up to date with things like apple silicon support.
I am getting some errors trying to build my app.
In line 43,
@as
is highlighted.This is with
rescript-compiler
from tag 9.1.4 built with OCaml 4.10.2+rescript.What am I doing wrong?