Title: java.lang.VerifyError: Bad operand type when invoking
Open Graph Title: java.lang.VerifyError: Bad operand type when invoking
X Title: java.lang.VerifyError: Bad operand type when invoking
Description: This is quite easy to reproduce. I created the smallest possible test set So, I have two classes, in the first one I have a singleton (for the test the instance is not stored but it doesn't matter now) and, for some reason, I use a suppl...
Open Graph Description: This is quite easy to reproduce. I created the smallest possible test set So, I have two classes, in the first one I have a singleton (for the test the instance is not stored but it doesn't matter ...
X Description: This is quite easy to reproduce. I created the smallest possible test set So, I have two classes, in the first one I have a singleton (for the test the instance is not stored but it doesn't mat...
Opengraph URL: https://github.com/luontola/retrolambda/issues/60
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"java.lang.VerifyError: Bad operand type when invoking \u003cinit\u003e","articleBody":"This is quite easy to reproduce. I created the smallest possible test set\n\nSo, I have two classes, in the first one I have a singleton (for the test the instance is not stored but it doesn't matter now) and, for some reason, I use a supplier to create the instance. This test works well if the supplier is created as an inner class or with lambda. It crashes when using the method reference (::new).\n\n``` java\npublic class Test1 {\n\n Test1() {}\n\n static Test1 get() {\n Supplier\u003cTest1\u003e s = Test1::new;\n return s.get();\n }\n\n interface Supplier\u003cE\u003e {\n E get();\n }\n}\n```\n\nSo there's a simple method get who creates the instance by using Test1::new method reference.\n\nThen there's a second class who calls the get():\n\n``` java\npublic class Test2 {\n public static void main(String[] args) {\n Test1.get();\n }\n}\n```\n\nWhen compiled with retrolambda, bytecode 51, and executed, the output is\n\n\u003e Exception in thread \"main\" java.lang.VerifyError: Bad operand type when invoking \u003cinit\u003e\n\u003e Exception Details:\n\u003e Location:\n\u003e Test1.access$lambda$0(LTest1;)V @1: invokespecial\n\u003e Reason:\n\u003e Invalid type: 'Test1' (current frame, stack[0])\n\u003e Current Frame:\n\u003e bci: @1\n\u003e flags: { }\n\u003e locals: { 'Test1' }\n\u003e stack: { 'Test1' }\n\u003e Bytecode:\n\u003e 0x0000000: 2ab7 001f b1\n\u003e at Test2.main(Test2.java:4)\n\nI tested with latest retrolambda 2.0.3 compiled with java 1.8.0_45\n","author":{"url":"https://github.com/pietrodev","@type":"Person","name":"pietrodev"},"datePublished":"2015-06-24T14:55:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/60/retrolambda/issues/60"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9a6f68de-c624-c5db-bc09-dba99e19208f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BC38:1CCFE3:325127A:42F97CC:6A654F63 |
| html-safe-nonce | 50f669e3da5f24d3d66a4b47a20f6350949899c5fd346ab677c3810337993867 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzM4OjFDQ0ZFMzozMjUxMjdBOjQyRjk3Q0M6NkE2NTRGNjMiLCJ2aXNpdG9yX2lkIjoiMjE1NjQxNjcxNzkwNDIzNjM4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2a47d0ce39a3c3c678c027d8c51823d9251969ed42817dca042a978de6e03311 |
| hovercard-subject-tag | issue:90700306 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/luontola/retrolambda/60/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb14043550334f8498cbbefba09e9022aa9fa06d3510ba88a70f658c85d9961b/luontola/retrolambda/issues/60 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb14043550334f8498cbbefba09e9022aa9fa06d3510ba88a70f658c85d9961b/luontola/retrolambda/issues/60 |
| og:image:alt | This is quite easy to reproduce. I created the smallest possible test set So, I have two classes, in the first one I have a singleton (for the test the instance is not stored but it doesn't matter ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pietrodev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| go-import | github.com/luontola/retrolambda git https://github.com/luontola/retrolambda.git |
| octolytics-dimension-user_id | 42678 |
| octolytics-dimension-user_login | luontola |
| octolytics-dimension-repository_id | 11543691 |
| octolytics-dimension-repository_nwo | luontola/retrolambda |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 11543691 |
| octolytics-dimension-repository_network_root_nwo | luontola/retrolambda |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width