Return-Path: X-Original-To: apmail-groovy-dev-archive@minotaur.apache.org Delivered-To: apmail-groovy-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CA91182EA for ; Tue, 25 Aug 2015 06:08:36 +0000 (UTC) Received: (qmail 85697 invoked by uid 500); 25 Aug 2015 06:08:36 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 85656 invoked by uid 500); 25 Aug 2015 06:08:36 -0000 Mailing-List: contact dev-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.incubator.apache.org Delivered-To: mailing list dev@groovy.incubator.apache.org Received: (qmail 85640 invoked by uid 99); 25 Aug 2015 06:08:36 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2015 06:08:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A07501AAB63 for ; Tue, 25 Aug 2015 06:08:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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_LIVE=1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id x7wG-08yeCjd for ; Tue, 25 Aug 2015 06:08:24 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id A474020864 for ; Tue, 25 Aug 2015 06:08:23 +0000 (UTC) Received: from [192.168.1.3] ([85.180.105.19]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LnOve-1Ynvd31Mx4-00hbAK for ; Tue, 25 Aug 2015 08:08:15 +0200 Message-ID: <55DC0678.9060108@gmx.org> Date: Tue, 25 Aug 2015 08:08:56 +0200 From: Jochen Theodorou User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: dev@groovy.incubator.apache.org Subject: Re: Numeric assignment documentation References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ja334xkDw6t/h1fZOUnDLzEFd6PSgKkdcCgC4GTarHhLvCakHFf HPiz9npC4h0LlUGcxiC+YXFK9pAJURlNfFMpas9XDKY1zI5xtKX4UcUMz95Qtae2vpAzSEf TqSTr9FhwVWfOMdt3iJZdfar2MldOboD+AlKE/y6KVtRg8dQNiipsB0XP0USv5DWOhezqFn cR1bPJyxYT1A9loJ3kIyQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:O/O75ZOUdJs=:dSELFEJdn4ImrPJIqzrWF3 TiO44U08FWfkuMZ2lZ709+/rTr310d5u5vu8ArxN0kaoTpJY/L6xR2TQSvfyHo8xnOd7Q2iN8 Jx0Y4XvCkVDMWVDnDqkUIOGpsyvyrQWPV0X9X4EiTZ4CbN0w1wRnpZSTyNoCMd40SpEZl/pZV o5FNcHhPUC3gXu7U5vcDlUK/gAC83e6q/SEuSWoK5whWntgUqzRHeVi/zWG/U/QC+9Wj6IAYt 2yunhfdrPPYShyy60v5mWTp34GOiqW6PstD61K3QvXQ2Yq/5/q3fi8Gnxf1OLeMhlC5vVhLAn VBV8AibzIYXauXXgR4TLsQgMIMcVOBeCjHWGk+y/H/A32vKCzwdCdrs61wyua1LQHfvI8wYQc 3hlOoo1loAQC8+SuUZ78OPw6fc+I8vKqEn3eVcqplJAywm9tRgh7Zj9CrIZIVKUUYrA1Pak85 SmQ8QLHPZp2fqvEuVmZkV8g3G8qIEE+Yx/TpbwIeIED/JPteMPqYhPOge4xOv2yJXQxs8wN1a Ot2lT+RpEpXUwVkX4t6GBYeUQW3nJetsqg2z9Eda/gVE9+84NYAEAsGXyDOXozC7hG1i2owIy DPNJB+3vp6KMkVU1iPLB8BHp0QcEvBRPhf6EFCpCkGWJLc0RUVlpWmHPN8LRFukAZ4ZRxBtYx SSSXVyVjg0fW6agad8s67ExPioJDFyn52XnLmZ557m6KoXej5gv/ENul3VlY29cawiy3+fMJ2 g8PzkVrFXxlL8+LmHf+ygUsWH9nZMhwMAAye3a+x3r+w9s0PbsE/wwj7fnGLoYmW82orucmam VAEVTVL7tGjnhUrEtqtLEOG3omqUtdo9f6h9F/IehJgn/bjoyk= Am 25.08.2015 01:01, schrieb Keegan Witt: > I ended up putting this in the Java vs Groovy section instead of where I > originally planned because it occurred to me that these conversions > apply to more than just assignment (e.g. method invocation). Here's > what I have so far: https://github.com/apache/incubator-groovy/pull/98. > > Besides wanting any feedback you might have (especially on other options > for the second table), I also wondered if these behaviors were intentional: > > * char -> byte requires a cast in Java, but doesn't in Groovy (even > with CompileStatic) the cast is like a security feature in Java, which we don't use in normal Groovy. That's why you can for example assign a long to a byte too. @compileStatic behaves different in that, but maybe this conversion has been forgotten > * Most boxing/unboxing works with CompileStatic, but not char -> > Character or Character -> char that looks like a bug to me > * Several inconsistencies around when casts are needed when working > with CompileStatic (e.g. short -> int and short -> Integer, and char > -> int work, but not char -> Integer) looks like char conversion is missing some aspects. I guess this is also due to the analogy of 1-char Strings and Character we use in normal Groovy (not supported by @CompileStatic) which did let us forget about some transformations bye blackdrag -- Jochen "blackdrag" Theodorou blog: http://blackdragsview.blogspot.com/