Bug 4252 - [AST] override bug in mcs ast
Summary: [AST] override bug in mcs ast
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: unspecified
Hardware: PC Linux
: Highest major
Target Milestone: ---
Assignee: Mike Krüger
: 4249 ()
Depends on:
Reported: 2012-04-05 01:41 UTC by Mike Krüger
Modified: 2013-03-25 05:23 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mike Krüger 2012-04-05 01:41:31 UTC
That bug leads to an invalid AST. The class scroll delegate ends too early 'override' starts the grid view controller. In that case this can lead to a code completion error in md.

I think that has regressed - used to work.

Test Case:
using System;
using System.Collections.Generic;
using System.Linq;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace GridDisplay
    public class GridViewController : UIViewController {
        UIScrollView scrollView;

        class ScrollDelegate : UIScrollViewDelegate {
            ScrollDelegate (GridViewController container)
                this.container = container;
		override foo


        public GridViewController () 

        public override void ViewDidLoad ()
            base.ViewDidLoad ();
            scrollView = new UIScrollView (View.Bounds);
            scrollView.Delegate = new ScrollDelegate (this);

        public override void DidRotate (UIInterfaceOrientation
            scrollView.Frame = View.Bounds;

    public class TvGuideViewController : GridViewController {

    [Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
        UIWindow window;

        public override bool FinishedLaunching (UIApplication app, NSDictionary
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.MakeKeyAndVisible ();
            window.RootViewController = new TvGuideViewController ();

            return true;
Comment 1 Mike Krüger 2012-04-05 01:42:05 UTC
*** Bug 4244 has been marked as a duplicate of this bug. ***
Comment 2 Mike Krüger 2012-04-05 01:42:20 UTC
*** Bug 4249 has been marked as a duplicate of this bug. ***
Comment 3 Mike Krüger 2012-04-05 01:55:21 UTC
Simpler case:

class Foo

    class Bar
          override foo

    public Foo () 
note: What's a bit strange is that it works when the constructuor has no modifiers.
Comment 4 Marek Safar 2012-04-10 07:59:50 UTC
This works for me with mcs master.

Foo::Members has 2 items Bar and Foo ctor

override foo is missing but that should not be big issue.
Comment 5 Marek Safar 2012-06-07 07:57:40 UTC
no response
Comment 6 Mike Krüger 2012-06-07 08:37:09 UTC
It's not about the members - that works it's about the modifiers. override is part of the constructor in the AST - which it isn't
Comment 7 Mike Krüger 2012-06-07 08:38:13 UTC
btw. that could be in nrefactory mcs only - the collection of the modifiers can be the problem I think. I need to look for that. If that is the case where do I need to reset them ?
Comment 8 Marek Safar 2013-03-22 10:50:41 UTC
I cannot reproduce it with master, closing.
Comment 9 Mike Krüger 2013-03-22 11:02:10 UTC
doesn't work for me 

Bar has a constructor with the body of Foo ()
Comment 10 Mike Krüger 2013-03-22 11:03:49 UTC
stop - I think it's working. Sorry.
Comment 11 Nischal 2013-03-25 02:38:30 UTC
Today, with the latest builds:

Mono 2.10.12

And now the issue does not exists. Below is the screencast for the same:

Hence, closing this issue.
Comment 12 Mike Krüger 2013-03-25 05:23:35 UTC
Nischal: that was a bug in the parser / AST creation. I just fixed it :)

@mareks: the incomplete_member was required for me to fix it. I tried it out today and got it working (I guessed that this was the problem :)) - thanks