Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Quick fix for parameter type based on use #332

Closed
gavinking opened this issue Jul 20, 2012 · 2 comments
Closed

Quick fix for parameter type based on use #332

gavinking opened this issue Jul 20, 2012 · 2 comments

Comments

@gavinking
Copy link
Contributor

So, thanks to @thradec and #58, in the following code:

  void x<T>(T y)  {
        print(y);
  }

I get proposed the quickfix Add generic type constraint 'T satisfies Object'. But there's actually another potential fix,namely to change the parameter type to T&Object, giving us:

  void x<T>(T&Object y)  {
        print(y);
  }

The same quick fix is also very relevant for formal attributes, not just for parameters. For example:

  class X<T>()  {
        formal T y;
        print(y);
  }
@gavinking
Copy link
Contributor Author

@thradec you want to take this one? I think it's very similar to the one you just did....

@gavinking
Copy link
Contributor Author

Don't worry, I did this one.

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

No branches or pull requests

1 participant