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 CF68B18BD6 for ; Fri, 9 Oct 2015 16:04:25 +0000 (UTC) Received: (qmail 73837 invoked by uid 500); 9 Oct 2015 16:04:25 -0000 Delivered-To: apmail-groovy-dev-archive@groovy.apache.org Received: (qmail 73800 invoked by uid 500); 9 Oct 2015 16:04:25 -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 73788 invoked by uid 99); 9 Oct 2015 16:04:25 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Oct 2015 16:04:25 +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 090781A25E2 for ; Fri, 9 Oct 2015 16:04:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.01 X-Spam-Level: X-Spam-Status: No, score=-0.01 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-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 aTmcqNCrmYMq for ; Fri, 9 Oct 2015 16:04:17 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 12CF224E1C for ; Fri, 9 Oct 2015 16:04:17 +0000 (UTC) Received: from [10.0.0.4] ([193.154.30.7]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LjZn2-1aLqqH2OTo-00bakM for ; Fri, 09 Oct 2015 18:04:09 +0200 Subject: Re: Type safety on sum()/getAt() To: dev@groovy.incubator.apache.org References: From: Pascal Schumacher Message-ID: <5617E579.5020905@gmx.net> Date: Fri, 9 Oct 2015 18:04:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:hqXAW2mIEFof4KpQrV/AKgD6mQbN7PuvEvqD6BHXAgzq0Fts+32 MyEP9BYvU2C4ZfSb9goizLedvk3I11tKukrzi93NJbjb4Ux6YxMLAOZx+BMJpOggeTAir6h /usRAAKtAl+0unlQB7E98Nf/c2Dtrm4K4MWOpXLfrhafvhc3XQHh9eYERVU+saAa6kVNjS6 a0piM0XKrPCyctJcQtXJw== X-UI-Out-Filterresults: notjunk:1;V01:K0:v4VSWxnvREs=:5Iknix4epyw08mORSiQInf 0K2X/6QQtFIRyFmuzecpxYJrl5Yu8EryjlWqsf9aHEstI3+EE1psV2Aud7w7LVGxR6cDuuSev 1kCMNCM+ecS3Y59psvmfjq3isvhAl3YX4HY/igc7W+BOfkllQUNGDIA72DRLUQGL0uHjpd5In n/kHcemsiU1FrdIXTZ5E7AxbOmek89YvNHSF5LkktZBhWXgwAJt3yTXyuFx8CNSLZNsiqNoxx wo2MGEKYvVhlM2TJsMKI2ziT6swfUHioL1jQ0yHEQJqSBo/mBtNn70yVjx8j6vJV0yt955khd uNtpibjijvMvgO1yrxMIMQLuOS76wxdJGcAnSOhAMMqhfVRJPKEJ4ywoV4WOJBQSroARWUeNz 2F+ClLdO84rYHexksLn8wjyLEawMnJKYO4IqQu469OIqJKmgKkSGcdL7IWSgARk9drGylAbxp W9KwwGtpbqqrMsfXW4AHbZ40iXbwLWhqdmKsJPEMpwbCE/kkTWFEY0n6GgI5t1KqwxlUzm0Ig FJSlOtXpsEMV3apPOiSgHrfQ2HtQjefQaw5V6kB43nnElUTTRbkmbGxdrFJjW+Qx0Gj6HUioX NhhtEENw8yOJCmwG+HWhQz8COv7VQ7GQaYNadDJsWS2gXVHfV3hYOYuzATKQgiq6sHTa3iWrv vWmP7Iwiwr4x6ivn9OJVt3bypxUYvtMlmR1GLYuna0AvPgydpTZKYfGt8Fr/xKUWHUVRsAGVp DgJv/Jwss5ViGHVPpyICtGmfPHrX+pXtWTcD5fJ/THIEUoOoAv5sF7DfMaVkwkUVRpsZN7Ici 7BUeMq3 Hi Peter, no idea if there are any special issues with updating sum() and getAt(), but in general there is room for improvement of parameterised types in DefaultGroovyMethods etc. E.g. this pull request: https://github.com/groovy/groovy-core/pull/610/files adds parameterised types to a lot of DefaultGroovyMethods and IOGroovyMethods but it was never merged due to lack of tests. -Pascal Am 09.10.2015 um 09:54 schrieb Peter Ledbrook: > Hi, > > I've noticed that @TypeChecked doesn't work so well with typed > collections and the sum() & getAt() methods (perhaps others as well). > I had a quick look at sum() in DefaultGroovyMethods and noticed that > it doesn't use parameterised types, unlike inject() for example. > > Would there be any issues with updating sum() and getAt() to work with > parameterised types? The current situation makes using @TypeChecked > harder than it needs to be. > > Thanks, > > Peter > > -- > Peter Ledbrook > t: @pledbrook > w: http://www.cacoethes.co.uk/