From notifications-return-12692-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Sun Jun 3 04:50:04 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 F0668180609 for ; Sun, 3 Jun 2018 04:50:03 +0200 (CEST) Received: (qmail 21866 invoked by uid 500); 3 Jun 2018 02:50:03 -0000 Mailing-List: contact notifications-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 notifications@groovy.apache.org Received: (qmail 21856 invoked by uid 99); 3 Jun 2018 02:50:03 -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; Sun, 03 Jun 2018 02:50:03 +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 8D40F1802F9 for ; Sun, 3 Jun 2018 02:50:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id x82STsBwIwUi for ; Sun, 3 Jun 2018 02:50:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8B1685F1ED for ; Sun, 3 Jun 2018 02:50:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9656CE0361 for ; Sun, 3 Jun 2018 02:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1BEAB21094 for ; Sun, 3 Jun 2018 02:50:00 +0000 (UTC) Date: Sun, 3 Jun 2018 02:50:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: notifications@groovy.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GROOVY-8583) Fail to infer auto-return type from ternary operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GROOVY-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499273#comment-16499273 ] ASF GitHub Bot commented on GROOVY-8583: ---------------------------------------- GitHub user jwagenleitner opened a pull request: https://github.com/apache/groovy/pull/747 GROOVY-8583: Fail to infer auto-return type from ternary operator You can merge this pull request into a Git repository by running: $ git pull https://github.com/jwagenleitner/groovy 8583-stc-ternary Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/747.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #747 ---- commit 884ddeb4d9aca6c4a68f22f7fbd7ce2ab77f51f1 Author: John Wagenleitner Date: 2018-06-03T02:17:08Z GROOVY-8583: Fail to infer auto-return type from ternary operator ---- > Fail to infer auto-return type from ternary operator > ---------------------------------------------------- > > Key: GROOVY-8583 > URL: https://issues.apache.org/jira/browse/GROOVY-8583 > Project: Groovy > Issue Type: Bug > Components: Static compilation, Static Type Checker > Reporter: Daniel Sun > Priority: Minor > > {code:java} > @groovy.transform.Field > String x = "X" > @groovy.transform.CompileStatic > public List getStrings() { > x ? [x] : Collections.emptyList() // fail > // return x ? [x] : Collections.emptyList() // succeed with `return` > } > getStrings() > {code} > SEE GROOVY-7753 -- This message was sent by Atlassian JIRA (v7.6.3#76005)