From dev-return-5453-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sat Sep 29 21:53:00 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C8403180672 for ; Sat, 29 Sep 2018 21:52:59 +0200 (CEST) Received: (qmail 72562 invoked by uid 500); 29 Sep 2018 19:52:58 -0000 Mailing-List: contact dev-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list dev@groovy.apache.org Received: (qmail 72552 invoked by uid 99); 29 Sep 2018 19:52:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2018 19:52:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id CC121C669A for ; Sat, 29 Sep 2018 19:52:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id UsLvjxiprLnW for ; Sat, 29 Sep 2018 19:52:56 +0000 (UTC) Received: from homiemail-a79.g.dreamhost.com (sub5.mail.dreamhost.com [208.113.200.129]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AC1BD5F1BD for ; Sat, 29 Sep 2018 19:52:56 +0000 (UTC) Received: from homiemail-a79.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTP id E64306002905 for ; Sat, 29 Sep 2018 12:52:49 -0700 (PDT) Received: from [192.168.1.130] (c-71-192-16-240.hsd1.ma.comcast.net [71.192.16.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: keith@suderman.com) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTPSA id ADEEE60023D4 for ; Sat, 29 Sep 2018 12:52:49 -0700 (PDT) From: Keith Suderman Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Bug or expected behaviour? Message-Id: <54700E40-EFD4-4380-B90B-1B97AE50BD48@anc.org> Date: Sat, 29 Sep 2018 15:52:48 -0400 To: dev@groovy.apache.org X-Mailer: Apple Mail (2.3445.6.18) Hello, I have a parent class that defines a static final String and a child = class that references the String in it's constructor. Essentially: class Parent {=20 static final String DEFAULT =3D 'default'=20 } class Child extends Parent { String value Child() { this(DEFAULT) } // Bad type on operand stack Child(String value) { this.value =3D value } } println new Child().value =20 However, when I try to run the code I get a "java.lang.VerifyError: Bad = type on operand stack" (see below). =46rom my understanding this = exception is caused when a constructor tries to use a variable/field = that has not been initialized yet; i.e. the `this(DEFAULT)` in the above = example. However, if I qualify the DEFAULT with the class name (i.e. = `this(Parent.DEFAULT)`) the code works as expected. Similar code in Java works without DEFAULT being qualified with the = superclass name. So I am wondering; is this a bug or a design decision = that was made somewhere/sometime? =20 I am using Groovy Version: 2.5.2 JVM: 1.8.0_40 Vendor: Oracle = Corporation OS: Mac OS X Cheers, Keith Caught: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: Child.()V @10: invokeinterface Reason: Type uninitializedThis (current frame, stack[2]) is not assignable = to 'java/lang/Object' Current Frame: bci: @10 flags: { flagThisUninit } locals: { uninitializedThis, = '[Lorg/codehaus/groovy/runtime/callsite/CallSite;' } stack: { uninitializedThis, = 'org/codehaus/groovy/runtime/callsite/CallSite', uninitializedThis } Bytecode: 0x0000000: b800 114c 2a2b 1212 322a b900 1802 00b8 0x0000010: 001e c000 20b7 0023 b1 =20