SwensenSoftware / unquote

Write F# unit test assertions as quoted expressions, get step-by-step failure messages for free
http://www.swensensoftware.com/unquote
Apache License 2.0
287 stars 25 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 7 May 2012 at 2:11

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r522.

Original comment by stephen....@gmail.com on 7 May 2012 at 4:24

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 20 May 2012 at 4:23