question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FABLE translates unsigned long integer ranges into infinite loops

See original GitHub issue

Description

The F# code [0UL..10UL] when translated via FABLE leads to an infinite loop

Repro code

Please provide the F# code to reproduce the problem. Ideally, it should be possible to easily turn this code into a unit test.

let main(argv[])=
    printfn "%A" [0UL..10UL]

Expected and actual results

Expected: list of 11 numbers Actual: loops forever

Related information

fable.io does this. Also FABLE 1.0.6

  • Fable version (dotnet fable --version):
  • Operating system: win 10 (translating to .Net Core 2.1.101)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alfonsogarciacarocommented, Sep 4, 2018

Sorry, I just noticed the range function didn’t deal with longs so I created a specialized one for them. Should be fixed in the next release 👍

0reactions
tomclcommented, Aug 31, 2018

@alfonsogarciacaro

The long range lock-up issue remains with 2.0.0-beta-003

A simple range of longs, anywhere in code, creates an infinite loop in the CLI and also REPL2

let y = [0L..10L]
  • The REPL2 code is: ofSeq(range( starting long, end long)
  • the start/end longs are correct.

I could probably PR this if I knew whether the compiler uses the same JS translation, and if so where ofSeq and range are located? I’m still not good at finding my way round the compiler internals!

It would be nice to deal with as many as possible of the integer corner cases…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why the infinite loop when data type is unsigned int?
The problem is that the loop for(i=count-1;i>=0;--i). will never exit if i is unsigned, because an unsigned integer is always greater than ...
Read more >
Extras.fs
A more functional construct on-top of Fable.Core. Contribute to Shmew/Fable.Extras development by creating an account on GitHub.
Read more >
What happens if loop till Maximum of Signed and Unsigned ...
Signed char range belongs from -2 7 to 2 7 -1, hence it also goes for the infinite execution if the limit is...
Read more >
lb
Easy tiger kau milikku mp3, Places that start with s in canada, Famille daoudi maroc, ... Nirulas home delivery number gurgaon, Bangla natok...
Read more >
unsigned long - Variables
Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found