Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't apply generic specifier to a local function #72

Closed
ka3a4ok opened this issue Sep 6, 2011 · 5 comments
Closed

Can't apply generic specifier to a local function #72

ka3a4ok opened this issue Sep 6, 2011 · 5 comments

Comments

@ka3a4ok
Copy link
Contributor

ka3a4ok commented Sep 6, 2011

Code examle, reprodusing error :

module Program
{
  fun1[T]():T where T:new()
  {
    T()
  }

  Main() : void
  {
    def fun2[T]():T where T:new()
    {
      T()
    }

    def t1=fun1.[int](); //ok
    def t2=fun2.[int](); //Error: don't know how to apply generic specifier to fun2.[?]
  }
}
@NN---
Copy link
Member

NN--- commented Sep 13, 2011

@VladD2
Copy link
Member

VladD2 commented Sep 20, 2011

The 1335 work well (on .Net 4).
And 661, 838 and 916 in not a bug, really.

@VladD2
Copy link
Member

VladD2 commented Sep 20, 2011

Fixed

@VladD2 VladD2 closed this as completed Sep 20, 2011
@NN---
Copy link
Member

NN--- commented Sep 21, 2011

1335 Compiles but fails in runtime:

using System.Console;

module M
{
  Main() : void 
  {
    def foo[T]()
    { 
        def bar[S]() where S : T
        {
        }

        bar
    }

    foo()();
  }
}

Unhandled Exception: System.TypeLoadException: Method has circular method type p
arameter constraints.

I disagree, I think those cases are bugs, otherwise we must disable local generic functions.

@VladD2
Copy link
Member

VladD2 commented Sep 21, 2011

OK, you can open new issue for this exemple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants