The piece of code generating the error is something like:
...
let arr = library.fun1 x (* library.fun1 : t1 -> t2 array *)
library.fun2 arr (* library.fun2 : t2 [] -> unit *)
...
The fact that the formal signature of the functions includes in one case, "t2 array", in the other "t2 []", though the two types should be identical, made me wonder if that may be the issue, along with the fact that both fun1 and fun2 reside in a different assembly.

Again, I can't reproduce the problem on a small scale. :-(

By on 12/11/2009 3:45 PM ()

We have fixed some bug involving remap_type_full; it may or may not be the same thing.

That said, we're happy to look at a repro - if you can reduce it, great; if not, if you don't mind sending big source code projects we'll take a look at those too. (mail to fsbugs)

By on 12/11/2009 4:05 PM ()

Mail sent :)

By on 12/12/2009 4:00 AM ()

As discovered by Don (thanks!),
this error may occur in the following scenario:

Library1 defines a function Fun that makes use of one or more types in Library2, but does not return any values of types defined in Library2.
Library3 makes a call to Fun, but its project does not include a reference to Library2.

Normally Library3 would not need a reference to Library2, since it doesn't use any of its types. A reference is however needed to include definitions used when code optimizations are enabled. This particular case is mishandled by the compiler, and it's the reason my project didn't compile in Release mode.

If Fun returned a value of a type defined in Library2, the missing reference would be handled correctly.

The fix for now is just to include in Library3 all references used by Library1.

Happy coding :)

By on 12/13/2009 6:15 AM ()

Please do send us a minimal repro of this - we are not aware of bugs in 1.9.7.8 that may be relevant to this.

thanks

don

By on 12/11/2009 4:51 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper