Skip to content
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

Have compiler return semantic errors in incomplete members. #7536

Open
CyrusNajmabadi opened this issue Dec 16, 2015 · 6 comments · May be fixed by #62874
Open

Have compiler return semantic errors in incomplete members. #7536

CyrusNajmabadi opened this issue Dec 16, 2015 · 6 comments · May be fixed by #62874

Comments

@CyrusNajmabadi
Copy link
Member

This is similar to #1867

Examples where we want semantic errors:

class C {
    Directory     //<-- want errors on Directory
    private int i; 
}

class Program {
    Func < FlowControl x    // <-- on both 'Func' and 'FlowControl'
} 

class C {
  [Extension]   //<-- in an attribute on nothing
} 

Note: i handled this in TypeScript by not even having the concept of an "Incomplete Member". If no existing member rule could parse out the text, then we fell back to "Field". This meant that we would properly consume the modifiers, attribute and type, and we'd give proper messages for when anything was missing.

By then being a field, all the remaining parts of the compiler just lit up and worked properly.

This is something we could consider doing in the C# compiler as well. (or we could just make it so that it binds Incomplete Members).

@CyrusNajmabadi
Copy link
Member Author

pinging @gafter

@gafter gafter modified the milestones: 1.3, 2.0 (RC) Mar 31, 2016
@jaredpar jaredpar modified the milestones: 1.3, 2.0 (RC) Mar 31, 2016
@gafter gafter modified the milestones: 2.1, 2.0 (RC) Jul 18, 2016
@gafter gafter modified the milestones: 2.0 (RTM), 2.1 Oct 28, 2016
@jcouv
Copy link
Member

jcouv commented Jan 14, 2017

@gafter @CyrusNajmabadi I don't think this meets the RTM bar. Moving out.

@jcouv jcouv modified the milestones: 2.1, 2.0 (RTM) Jan 14, 2017
@jaredpar jaredpar modified the milestones: 15.3, 15.1 Mar 9, 2017
@jaredpar jaredpar modified the milestones: 15.later, 15.3 Mar 27, 2017
@gafter gafter modified the milestones: 15.6, 16.0 Nov 28, 2017
@jaredpar jaredpar modified the milestones: 16.0, Unknown Sep 7, 2018
@gafter gafter removed their assignment Jul 2, 2020
@CyrusNajmabadi
Copy link
Member Author

@jaredpar @jcouv IDE still needs this. Right now we have to have our own binder here and it means even basic things like public DateTime are things we have to manually analyze and understand ourselves (since this is an incomplete member where no binding happens).

It's really just a layer of hacks that continually causes us problems and leads to weird bugs for users that we're always chasing down and attempting to stamp out. Could we get some compiler eyes on this? Thanks!

@jaredpar
Copy link
Member

jaredpar commented May 6, 2021

This is something we'd need to discuss in the post 17.0 timeframe. At this point between C# 10 and the IDE work we're taking on we're over booked for 17.0.

@CyrusNajmabadi
Copy link
Member Author

@jaredpar can we assign this to someone though?

@jaredpar
Copy link
Member

jaredpar commented May 6, 2021

We can but I'm not sure what that is going to help here. Until we have a priority for this relative to other asks not going to make progress on it.

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

Successfully merging a pull request may close this issue.

5 participants