From dev-return-5310-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Wed Sep 5 06:50: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 728F7180654 for ; Wed, 5 Sep 2018 06:50:00 +0200 (CEST) Received: (qmail 83827 invoked by uid 500); 5 Sep 2018 04:49:59 -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 83815 invoked by uid 99); 5 Sep 2018 04:49:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2018 04:49:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4EA471806A7 for ; Wed, 5 Sep 2018 04:49:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.471 X-Spam-Level: *** X-Spam-Status: No, score=3.471 tagged_above=-999 required=6.31 tests=[FORGED_HOTMAIL_RCVD2=1.187, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Z_HLNGzGym_k for ; Wed, 5 Sep 2018 04:49:57 +0000 (UTC) Received: from n5.nabble.com (n5.nabble.com [162.253.133.81]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 54A395F175 for ; Wed, 5 Sep 2018 04:49:57 +0000 (UTC) Received: from n5.nabble.com (localhost [127.0.0.1]) by n5.nabble.com (Postfix) with ESMTP id 680A4887AD24 for ; Tue, 4 Sep 2018 21:49:56 -0700 (MST) Date: Tue, 4 Sep 2018 21:49:56 -0700 (MST) From: Daniel Sun To: dev@groovy.incubator.apache.org Message-ID: <1536122996422-0.post@n5.nabble.com> Subject: About type inference of method return value MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all, I am going to refine the type inference of method return value, the methods should match one of the following charactristics: 1) `final` 2) `private` 3) `static` 4) method defined in Script The above methods will not be overrided and have exact method return type. Any thoughts? P.S. Currently the following code will fail to compile, but it's obiviously valid. ``` @groovy.transform.CompileStatic class Test { static m() { return 'abc' } static a() { return m().length() } static void main(String[] args) { assert 3 == a() } } ``` Cheers, Daniel.Sun -- Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html