You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/09/04 13:51:45 UTC

[GitHub] [groovy] eric-milles commented on pull request #1359: GROOVY-9635: resolve "V" in T=V; "T" may have been reused as type param

eric-milles commented on pull request #1359:
URL: https://github.com/apache/groovy/pull/1359#issuecomment-687158819


   Is it because a Number type is never supplied for C?
   
   From: Paul King <no...@github.com>
   Sent: Friday, September 4, 2020 1:03 AM
   To: apache/groovy <gr...@noreply.github.com>
   Cc: Milles, Eric (TR Technology) <er...@thomsonreuters.com>; Author <au...@noreply.github.com>
   Subject: Re: [apache/groovy] GROOVY-9635: resolve "V" in T=V; "T" may have been reused as type param (#1359)
   
   
   The following script fails with a VerifyError with this PR merged:
   
   import java.util.function.Function
   
   @groovy.transform.CompileStatic
   
   class C<R extends Number> {
   
       def <V> V m(Function<C, V> f) { // R from C is confused with R->V from Function
   
           V result = f.apply(this)
   
           return result
   
       }
   
   }
   
   
   
   @groovy.transform.CompileStatic
   
   def method() {
   
       def ret = new C().m(new Function<C, String>() {
   
           @Override
   
           String apply(C that) {
   
               return 'foo'
   
           }
   
       })
   
       assert ret == 'foo'
   
   }
   
   
   
   method()
   
   —
   You are receiving this because you authored the thread.
   Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fgroovy%2Fpull%2F1359%23issuecomment-686930325&data=02%7C01%7Ceric.milles%40thomsonreuters.com%7C69b89ffe5a4847092fa308d85098342c%7C62ccb8646a1a4b5d8e1c397dec1a8258%7C0%7C0%7C637347961922283071&sdata=6vNHDl%2B%2B01KImfLmay9X%2BFOaGYNZiBWMzSxMU53QSbo%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEKZ3CSQBI52FUBYNSLQEUTSEB7J5ANCNFSM4QRAJSWQ&data=02%7C01%7Ceric.milles%40thomsonreuters.com%7C69b89ffe5a4847092fa308d85098342c%7C62ccb8646a1a4b5d8e1c397dec1a8258%7C0%7C0%7C637347961922293065&sdata=bObBkbDI9AZ9wgdR1oROTPw%2B88tXN2nQMx5glnrGf%2FY%3D&reserved=0>.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org