﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
196	Forward Declaring Generic Types Crash with Dtypes	ajbeach		"So polymorphic types can lead to an assertion failure if there is a reference to a reference to a forward declared polymorphic type where the type parameter is a dtype.

Here is the error message:
{{{
*CFA assertion error* ""baseParam == baseParams.end() && param == params.end()"" from program ""cfa-cpp"" in ""GenPoly::genericType GenPoly::makeSubstitutions(const std::__cxx11::list<TypeDecl*>&, const std::__cxx11::list<Expression*>&, std::__cxx11::list<TypeExpr*>&)"" at line 268 in file ""GenPoly/InstantiateGeneric.cc"": Type parameters should match type variables
}}}

Here are two different ways to reproduce the error, both are pretty minimal:
{{{
forall(dtype T)
struct link;

forall(dtype T)
struct link {
    link(T) * next;
};
}}}

{{{
forall(dtype T)
struct foo;

forall(dtype U)
struct bar {
    foo(U) * data;
};

forall(dtype T)
struct foo {};
}}}
Changing the first `dtype` in either example to an `otype` will cause them to compile successfully. You can also reorder the declarations to fix them and changing the other polymorphic variable declarations doesn't change anything with most combinations."	defect	closed	major	cfa-cc	1.0	fixed		
