Skip to content

Decompiler bug: op_Range and op_RangeStep sequence construction syntax shouldn't always be used #91

@GoogleCodeExporter

Description

@GoogleCodeExporter
When op_Range and op_RangeStep have signatures (from re-definition) that don't 
match the expected args or the expected return type (seq<'a>) (i.e. they are no 
longer operators and are now just "symbolic functions"), they should not be 
decompiled using the sequence construction syntax. 

For example, the following is invalid:

> let (.. ..) x y z h = x + y + z + h;;

val ( .. .. ) : int -> int -> int -> int -> int

> unquote <@ ( .. .. ) 1 2 3 4 @>;;

{1..2..3}
10

val it : unit = ()

Though the following would be valid:

> let (.. ..) x y z = Seq.singleton (x + y + z);;

val ( .. .. ) : int -> int -> int -> seq<int>

> unquote <@ [1 .. 2 .. 3] @>;;

[1..2..3]
[6]

val it : unit = ()


Original issue reported on code.google.com by stephen....@gmail.com on 7 May 2012 at 2:09

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions