Bug 27881 - Bad virtual lookup for new abstract member
Summary: Bad virtual lookup for new abstract member
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-11 09:46 UTC by Marek Safar
Modified: 2015-03-11 09:46 UTC (History)
2 users (show)

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


Attachments

Description Marek Safar 2015-03-11 09:46:41 UTC
This can be reproduced by removing following change https://github.com/mono/referencesource/commit/7e80630117b1306dc45e1c2714ebc1f9ee7f5f82#diff-a829552ca1f75843316e6ef328738274R344

compiling mscorlib then this program fails when run against "broken" mscorlib

using System.Reflection;
using System;

class X
{
	public static void Main ()
	{
		MemberInfo mi = typeof (System.DBNull);
		System.Console.WriteLine (mi.Module);
	}
}

It should be equivalent to this hierarchy but I cannot reproduce it using small repro

public abstract class A
{
	public virtual int Prop {
		get {
			Console.WriteLine ("1");
			return 1;
		}
	}
}

public abstract class B : A
{
	public new abstract int Prop { get; }
}

public class C : B
{
	public override int Prop {
		get {
			return 3;
		}
	}
}

public class D : C
{

}

Note You need to log in before you can comment on or make changes to this bug.