[
https://issues.apache.org/jira/browse/GROOVY-12151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18098942#comment-18098942
]
ASF GitHub Bot commented on GROOVY-12151:
-----------------------------------------
blackdrag commented on code in PR #2709:
URL: https://github.com/apache/groovy/pull/2709#discussion_r3646429161
##########
src/test/groovy/org/codehaus/groovy/transform/PackedClosureBoundariesTest.groovy:
##########
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.codehaus.groovy.transform
+
+import org.codehaus.groovy.control.CompilationUnit
+import org.codehaus.groovy.control.CompilerConfiguration
+import org.codehaus.groovy.control.Phases
+import org.junit.jupiter.api.Test
+
+import static org.junit.jupiter.api.Assertions.assertEquals
+
+/**
+ * The packability boundary as one readable matrix — executable documentation
of GEP-27's
+ * "packability decision procedure". Each case is a method body containing one
closure literal;
+ * the assertion is whether that literal packs (no generated closure class) or
declines (keeps
+ * its class), under the flag with {@code @CompileStatic} or dynamic
compilation as noted.
+ * Individual gates have focused behavioural tests elsewhere; this class
exists so the whole
+ * boundary can be read top-to-bottom in one place.
+ */
+final class PackedClosureBoundariesTest {
+
+ private static final String PROP = CompilerConfiguration.CLOSURE_PACKING
+
+ /** [description, dynamic-packs?, cs-packs?, method body containing
exactly one closure literal] */
+ private static final List CASES = [
+ // --
> hoist eligible closure bodies to a shared adapter @PackedClosures/flag
> (GEP-27 S1)
> ----------------------------------------------------------------------------------
>
> Key: GROOVY-12151
> URL: https://issues.apache.org/jira/browse/GROOVY-12151
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)