Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #237 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

wrong implicit cast on return [x64]

Reported by: mwarning Assigned to: ChristianK
Priority: critical Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

This code doesn't work for latest ldc (x64).
Works for dmd (x32).

interface A
{
	void foo();
}

class B : A
{
	void foo(){}
}

class C
{
	B b;
	
	A get()
	{
		assert(b is null);
		return b;
	}
}

void main()
{
	auto c = new C();
	A a = c.get();
	assert(a is null); //assert fails
}

Change History

03/19/09 16:06:22 changed by mandel

  • priority changed from major to critical.

This is a rather nasty problem.

03/20/09 09:28:32 changed by mandel

simplified

interface A
{
	void foo();
}

class B : A
{
	void foo(){}
}

A get()
{
	B b;
	assert(b is null);
	return b;
}

void main()
{
	A a = get();
	assert(a is null); //assert fails
}

03/20/09 10:52:57 changed by fvbommel

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1128]

Copyright © 2008, LDC Development Team.