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 or F# Quotation Bug: generic empty list treated as call #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Possibly a Quotation bug, resolution uncertain:

> let xl = [];;

val xl : 'a list

> <@ xl @>;;

  <@ xl @>;;
  ^^^^^^^^

C:\Users\Stephen\AppData\Local\Temp\stdin(9,1): error FS0030: Value 
restriction. The value 'it' has been inferred to have generic type
    val it : Expr<'_a list>    
Either define 'it' as a simple data term, make it a function with explicit 
arguments or, if you do not intend for it to be generic, add a type annotation.
> <@@ xl @@>;;
val it : Expr =
  Call (None,
      Microsoft.FSharp.Collections.FSharpList`1[System.Object] xl[Object](), [])
    {CustomAttributes = [NewTuple (Value ("DebugRange"),
          NewTuple (Value ("stdin"), Value (10), Value (4), Value (10),
                    Value (6)))];
     Type = Microsoft.FSharp.Collections.FSharpList`1[System.Object];}
> source <@ xl @>
;;
val it : string = "xl()"

Original issue reported on code.google.com by stephen....@gmail.com on 20 Feb 2011 at 2:55

GoogleCodeExporter commented 9 years ago
turned out to be an instance of issue 17, but didn't get fixed with that issue 
due to a bug where functions with inferable generic args were not being taken 
into consideration.

Original comment by stephen....@gmail.com on 22 Mar 2011 at 1:55

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 22 Mar 2011 at 1:56

GoogleCodeExporter commented 9 years ago
removing premature milestone label assignment, from now on will hold off 
applying the label until release is actually ready (for example, I am planning 
on calling the next release 1.3.0 instead of 1.2.4 due to significant feature 
enhancements).

Original comment by stephen....@gmail.com on 27 Mar 2011 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by stephen....@gmail.com on 2 Apr 2011 at 7:59