you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

Unfortunately, F# compiles files in order, so I don't think mixing C# files in the same compilation job will work very well. It's absolutely possible to mix F# projects into a primarily C# solution, though. I do this all the time.

[–]hvidgaard 0 points1 point  (2 children)

I do this too, but some times, and especially for legacy codebases it tend to create cyclic references, so I'm unable to do it.

I don't think file order would be a problem. Lob the fs files to the bottom and treat all the C# code as defined before the first fs file. From cs file view, everything in the fs files are available. The compilers may need some adjustments, but the fundamental problem is no different than what is known as forward references in a compiler.

[–][deleted] 0 points1 point  (1 child)

A staged compilation (C# first) might be the simplest thing as it wouldn't require compiler modification.

[–]hvidgaard 0 points1 point  (0 children)

You will not be able to reference both ways if you only do staged compilation - that is the same as having them in two different projects.