[
https://issues.apache.org/jira/browse/GROOVY-12450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126845#comment-18126845
]
ASF GitHub Bot commented on GROOVY-12450:
-----------------------------------------
testlens-app[bot] commented on PR #2979:
URL: https://github.com/apache/groovy/pull/2979#issuecomment-6154355335
## ✅ All tests passed ✅
🏷️ Commit: c2f78d83cb34ff64734dfa368022056d72126d92
▶️ Tests: 121851 executed
⚪️ Checks: 32/32 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> Provide some of Groovy's enhanced record features (getAt, toMap, toList,
> size) for groovy.time.Timed
> ----------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12450
> URL: https://issues.apache.org/jira/browse/GROOVY-12450
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
> This works:
> {code:groovy}
> def (result: r, duration: d) = System.timed {
> new Date()
> }
> println r
> println d.toNanos()
> {code}
> But the shorter variant fails:
> {code:groovy}
> def (r, d) = System.timed {
> new Date()
> }
> println r
> println d
> {code}
> with:
> {noformat}
> MissingMethodException: No signature of method: getAt for class:
> groovy.time.Timed is applicable for argument types: (Integer) values: [0]
> {noformat}
> We could make Timed a Groovy record instead of a Java record, or provide
> getAt(int) and any other methods we may want, e.g. toMap, etc.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)