Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding an untyped quotation in a typed quotation results in ArgumentException #89

Closed
latkin opened this issue Jan 22, 2015 · 2 comments
Labels

Comments

@latkin
Copy link
Contributor

latkin commented Jan 22, 2015

This repros back to F# 3.0 at least. Compiles fine, but throws at runtime.

<@ <@@ 100 @@> @>
System.ArgumentException: Type mismatch when building 'expr': the expression has the wrong type. Expected 'Microsoft.FSharp.Quotations.FSharpExpr', but received type 'Microsoft.FSharp.Quotations.FSharpExpr`1[System.Int32]'.
Parameter name: receivedType
   at Microsoft.FSharp.Quotations.PatternsModule.checkTypesSR[a](Type expectedType, Type receivedType, a name, String threeHoleSR)
   at Microsoft.FSharp.Quotations.PatternsModule.cast[T](FSharpExpr expr)
   at <StartupCode$FSI_0002>.$FSI_0002.main@()
@latkin latkin added the Bug label Jan 22, 2015
@forki
Copy link
Contributor

forki commented Jan 26, 2015

What is the expected behavior?

@latkin
Copy link
Contributor Author

latkin commented Jan 26, 2015

<@@ <@ 100 @> @@>   // works, Expr
<@@ <@@ 100 @@> @@> // works, Expr
<@ <@ 100 @> @>     // works, Expr<Expr<int>>
<@ <@@ 100 @@> @>   // fails, expecting Expr<Expr>

dsyme added a commit to dsyme/fsharp that referenced this issue Jan 27, 2015
@dsyme dsyme closed this as completed in 0a23b20 Jan 28, 2015
@latkin latkin added the fixed label Jan 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants