-
Notifications
You must be signed in to change notification settings - Fork 335
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
Enums are being flag as an error #462
Comments
How can I get RoslynPad 17 to load NetCoreApp references? I am invoking the apis from the RoslynPad 17 (4.4.0) editor. Using the following code snippet: ` #if DEBUG private static IEnumerable DefaultReferences()
} // Creating these defaults are redundant and are not required //**************** I am compiling as so:
` |
Describe the bug
A sample code snippet:
`Hi,
I'm trying to reference a Enum created in the dll test.dll.
The Enum "EDKPivotType" was created in the file "PathToMyCompiledScript\test.cs".
The file "test.cs" compile and create the test.dll file OK.
In the code sntppet below (which consumes file test.dll) intellisense recognize the enum "EDKPivotType" and it shows all the enum selections associated with it. However, the default editor used to demonstrate RoslynPad 17 (4.4.0) underlines the enum variable EDKPivotType in RED. The error is: CS0012: The type 'Enum' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Nevertheless, intellisence paints this enum with a foreground color of green. I do reference System.Private.CoreLib.
RoslynPad 17, Version 4.4.0
`
#r "PathToMyCompiledScript\test.dll"
using System;
using ...
class Program
{
static void Main()
{
EDKPivotType testenum = EDKPivotType.HLURD; // This line is flagged as an error
string name = testenum ?.ToString() ?? "Error";
}
}
`
To Reproduce
Create a CS file with an Enum. Create a second file to consume the enum as above.
Expected behavior
The sample script above should compile error free.
Version
RoslynPad 17, 4.4.0
Windows 11
VS 2022 17.5.3
Thank you for your time and effort.
The text was updated successfully, but these errors were encountered: