fable-compiler / Fable

F# to JavaScript, TypeScript, Python, Rust and Dart Compiler
http://fable.io/
MIT License
2.93k stars 301 forks source link

System.String.EndsWith is not supported by Fable #3934

Closed laurentpayot closed 1 month ago

laurentpayot commented 1 month ago

Description

I have a project where I use FSharpPlus. When pretest-compiling its Fable.Mocha test project with dotnet fable ./tests/tests.fsproj -o output/tests, I get the following:

./output/tests/fable_modules/FSharpPlus.1.6.1/Extensions/String.fs(74,8): (74,72) error FABLE: System.String.EndsWith is not supported by Fable
Compilation failed

Is FSharpPlus endsWith code the culprit? Or could it be something special in the way endsWith is implemented in Fable?

Related information

laurentpayot commented 1 month ago

Related to https://github.com/fable-compiler/Fable/issues/2601?

ncave commented 1 month ago

Fixed by #3935

laurentpayot commented 1 month ago

Awesome. Thanks @ncave!

ncave commented 1 month ago

@laurentpayot No worries, mate, it's easy when the code is mostly already there, just needs to be enabled.

Once released, you may want to submit a PR for FSharpPlus repo to have the conditional around startsWith removed too.

laurentpayot commented 1 month ago

@ncave Just waiting for the release to do the PR then :wink: