﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
185	Cannot declare generic struct with zero type parameters	mlbrooks		"Wishing for:
{{{
forall ( | {void fun();} ) {

    struct thing {};

    void ?{}( thing & this ) {
        fun();
    }
}

void fun() {
    printf(""this is fun\n"");
}

int main() {
   thing x;
}
}}}

That is, the forall is used only to declare an assertion.

Expect: compile succeeds; run prints
{{{
this is fun
}}}

Actual: compiler error
{{{
Too few type arguments in generic type instance of struct thing with body 1
}}}

Workaround is to treat the generic type as if it had one type parameter, i.e.
{{{
forall ( dtype T | {void fun();} ) {

    struct thing ...
}}}

This workaround is
{{{
forall ( | {void fun();} ) {

    struct thing {};

    void ?{}( thing(float) & this ) {
        fun();
    }
}

void fun() {
    printf(""this is fun\n"");
}

int main() {
   thing(float) x;
}
}}}

Workaround Expected: compiler error
{{{
Too many type arguments in generic type instance of struct thing...
}}}

Workaround Actual: compile succeeds; run prints
{{{
this is fun
}}}
"	defect	new	major	cfa-cc	1.0			
