Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inconsistent accessibility: field type 'world' is less accessible than field 'frmSplashScreen

I have this error called Inconsistent accessibility:

field type 'world' is less accessible than field 'frmSplashScreen'

In my code there is a public partial class called frmSplashScreen

There is also a public class called world

The line that caused the error was:

private world currentWorld; 

The above line is in the class frmSplashScreen

What is causing the problem?

like image 953
user1761786 Avatar asked Oct 20 '12 16:10

user1761786


2 Answers

This can also happen when you have not initialized your class "world" as public

you should do :

public class world

Instead of :

class world
like image 166
BasssS Avatar answered Oct 16 '22 20:10

BasssS


Generally this happens because your field is private. You must change it to public:

public world currentWorld;

For more on this, take a look here: Restrictions on Using Accessibility Levels (C# Reference)

like image 24
Leniel Maccaferri Avatar answered Oct 16 '22 22:10

Leniel Maccaferri