Skip to content

CSharp Loader F# Support: hello sample #5

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

Closed
wants to merge 2 commits into from
Closed

CSharp Loader F# Support: hello sample #5

wants to merge 2 commits into from

Conversation

avestura
Copy link

Added F# hello sample from C# sample

@viferga viferga changed the title Add F# hello sample CSharp Loader F# Support: hello sample Mar 20, 2019
@viferga
Copy link
Member

viferga commented Mar 20, 2019

It seems not to work when trying to load it as a script. It has been tested with metacallcli:

CS0116: A namespace cannot directly contain members such as fields or methods
CS1514: { expected
CS1022: Type or namespace definition, or end-of-file expected
CS1002: ; expected
CS1022: Type or namespace definition, or end-of-file expected
CS0116: A namespace cannot directly contain members such as fields or methods
CS1022: Type or namespace definition, or end-of-file expected
CS1002: ; expected
CS1520: Method must have a return type
CS1002: ; expected
CS1022: Type or namespace definition, or end-of-file expected
CS1514: { expected
CS1513: } expected
CS1002: ; expected
...

This is happening because of this method only supports CSharp. An addition would be to use F# compiler services to implement full support to F#. Visual Basic can be easily done too, with less work (only file extension detection and switch between SyntaxTree depending on it).

Compiled DLL not tested, but I think it should work because of uniformity of netcore assemblies.

@avestura
Copy link
Author

That's all true. Roslyn is the compiler platform for only C# and VB, thus it can't analyze F# source codes. This is a sample for testing F# support, using the C# loader for .NET Assemblies. I'll add the project file for easier compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants