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

Ticket #246 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

function definition is broken for tuple arguments

Reported by: ChristianK Assigned to: lindquist
Priority: major Milestone:
Component: backend Version: hg tip
Keywords: tuple function argument parameter Cc:

Description

The test case (run/t/tuple_15_A.d):

template TypeTuple(TList...){
	alias TList TypeTuple;
}

void main(){
	auto y = function(TypeTuple!(uint,uint) ab){};
}

triggers the assert in functions.cpp:723

f->fty.args.size() == fd->parameters->dim

with 2 == 1. This is because TypeFunction has tuples unfolded whereas 'ab' is only a single VarDeclaration in fd->parameters.

Change History

03/29/09 16:36:50 changed by fvbommel

This fails on DMD too.

FuncDeclaration::semantic3() tries to expand parameter tuples, but seems to fail in this case; apparently the type is still a template instance, not an actual tuple, when it runs.

03/29/09 18:32:09 changed by fvbommel

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

Should be fixed in r1177. Maybe this should also be submitted to Walter?

03/30/09 08:33:57 changed by fvbommel

This was D bug #854. I've attached a patch there.

Copyright © 2008, LDC Development Team.