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

Ticket #269 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Bad codegen for writing to a file with Tango

Reported by: Deewiant Assigned to: lindquist
Priority: major Milestone:
Component: backend Version: hg tip
Keywords: Cc:

Description

import tango.io.device.File;

void main() {
	File file = new File("foo", File.WriteCreate);
	file.output.write("x");
}

With LDC r1227 on x86-64, the above is fine and creates a file called "foo" containing the single byte x. With r1257 as well as the current tip, r1263, though:

tango.core.Exception.IOException: foo :: Bad file descriptor

Change History

04/25/09 13:01:05 changed by Deewiant

The following still works, though:

import tango.io.device.File;

void main() {
	File file = new File("foo", File.WriteCreate);
	file.write("x");
}

04/26/09 04:36:00 changed by ChristianK

Reduced to this test case (see tests/mini/virtcall2.d)

extern(C) int printf(char*, ...);

interface Input { void input(); }
interface Output { void output(); }
interface Conduit : Input, Output {}

class T : Conduit
{
  void output() { printf("out\n"); }
  void input() { printf("in\n"); }
}

void main()
{
  auto t = new T;
  Output o = t;
  o.output();
}

that outputs "in".

04/26/09 05:30:31 changed by ChristianK

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

Fixed in [1265].

Copyright © 2008, LDC Development Team.