PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: CuyZ/Valinor (php)

Issue:
Issue with variadic parameter contains generics
After upgrade from 1.7 to 1.12, my code broke even though I didn't make any changes. I was using [`ramsey/collection`](https://github.com/ramsey/collection/) for my DTO. `UnresolvableType` was thrown, but there was no specific error message provided. After further debugging, I believe this is the cause of the error.

![image](https://github.com/CuyZ/Valinor/assets/1808758/2e244374-d7bf-4225-b9c5-b2413e36cf64)

This is the docblock of `merge` method which I'm not use anyway.

```php
/**
 * @param CollectionInterface<T> ...$collections The collections to merge.
 *
 * @return CollectionInterface<T>
 *
 * @throws CollectionMismatchException if unable to merge any of the given
 *     collections or items within the given collections due to type
 *     mismatch errors.
 */
public function merge(CollectionInterface ...$collections): CollectionInterface
```

Pull request:
fix: do not override invalid variadic parameter type
Fixes #533 

Patch:
diff --git a/src/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolver.php b/src/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolver.php
index bab24b0..0a73282 100644
--- a/src/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolver.php
+++ b/src/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolver.php
@@ -8,6 +8,7 @@ use CuyZ\Valinor\Type\Parser\Lexer\Annotations;
 use CuyZ\Valinor\Type\Type;
 use CuyZ\Valinor\Type\Types\ArrayKeyType;
 use CuyZ\Valinor\Type\Types\ArrayType;
+use CuyZ\Valinor\Type\Types\UnresolvableType;
 use ReflectionParameter;
 
 /** @internal */
@@ -32,7 +33,7 @@ final class ParameterTypeResolver
 
         $type = $this->typeResolver->resolveType($reflection->getType(), $docBlockType);
 
-        if ($reflection->isVariadic()) {
+        if ($reflection->isVariadic() && ! $type instanceof UnresolvableType) {
             return new ArrayType(ArrayKeyType::default(), $type);
         }
 


Test patch:
diff --git a/tests/Functional/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolverTest.php b/tests/Functional/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolverTest.php
index aad55e8..7284965 100644
--- a/tests/Functional/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolverTest.php
+++ b/tests/Functional/Definition/Repository/Reflection/TypeResolver/ParameterTypeResolverTest.php
@@ -154,4 +154,19 @@ final class ParameterTypeResolverTest extends TestCase
             'string',
         ];
     }
+
+    public function test_invalid_parameter_type_stays_invalid_when_variadic(): void
+    {
+        $reflection = new ReflectionParameter(
+            /**
+             * @param InvalidValue $value
+             */
+            static function (...$value): void {},
+            'value',
+        );
+
+        $type = $this->resolver->resolveTypeFor($reflection);
+
+        self::assertInstanceOf(UnresolvableType::class, $type);
+    }
 }
Repository: mostjs/core (ts)

Issue:
Return canonical empty() in map operation
If the input stream is `empty()`, return the canonical `empty()`.

Reference #152 



Pull request:
Map return canonical empty
Close #178
Reference #152 

Signed-off-by: Frederik Krautwald <fkrautwald@gmail.com>

Patch:
diff --git a/packages/core/src/fusion/Map.js b/packages/core/src/fusion/Map.js
index 7d53101..710e36e 100644
--- a/packages/core/src/fusion/Map.js
+++ b/packages/core/src/fusion/Map.js
@@ -6,6 +6,7 @@ import Pipe from '../sink/Pipe'
 import Filter from './Filter'
 import FilterMap from './FilterMap'
 import { compose } from '@most/prelude'
+import { isCanonicalEmpty, empty } from '../source/empty'
 
 export default class Map {
   constructor (f, source) {
@@ -25,6 +26,10 @@ export default class Map {
    * @returns {Map|FilterMap} mapped source, possibly fused
    */
   static create (f, source) {
+    if (isCanonicalEmpty(source)) {
+      return empty()
+    }
+
     if (source instanceof Map) {
       return new Map(compose(f, source.f), source.source)
     }


Test patch:
diff --git a/packages/core/test/transform-test.js b/packages/core/test/transform-test.js
index de637c5..8ce9bd8 100644
--- a/packages/core/test/transform-test.js
+++ b/packages/core/test/transform-test.js
@@ -1,11 +1,13 @@
 import { describe, it } from 'mocha'
-import { eq } from '@briancavalier/assert'
+import { eq, assert } from '@briancavalier/assert'
 
 import { assertSame } from './helper/stream-helper'
 import { map, tap, constant } from '../src/combinator/transform'
 import { now } from '../src/source/now'
+import { empty, isCanonicalEmpty } from '../src/source/empty'
 
 import { collectEventsFor } from './helper/testEnv'
+import { id } from '@most/prelude'
 
 describe('map', function () {
   it('should satisfy identity', function () {
@@ -26,6 +28,17 @@ describe('map', function () {
       map(f, map(g, u))
     )
   })
+
+  describe('given a canonical empty stream', function () {
+    it('should return a canonical empty stream', function () {
+      // Fixture setup
+      const emptyStream = empty()
+      // Exercise system
+      const sut = map(id, emptyStream)
+      // Verify outcome
+      assert(isCanonicalEmpty(sut))
+    })
+  })
 })
 
 describe('constant', function () {