PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: joernio/joern (scala)

Issue:
jssrc: wrong argument indizes in push calls within desugared array literals
```
joern> workspace.reset ; importCode.jssrc.fromString("""[0]""")
...
joern> cpg.literal.size
val res1: Int = 1
joern> cpg.literal.head.argumentIndex
val res4: Int = 2
joern> cpg.literal.expressionUp.code.head
val res5: String = "_tmp_0.push(0)"
joern> cpg.literal.inCall.argument.isIdentifier.argumentIndex.head
val res15: Int = 1
```

Pull request:
Fixes: https://github.com/joernio/joern/issues/2049

Patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
index 9d0e8e5666ab..e58eb1e28b6c 100644
--- a/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/main/scala/io/joern/jssrc2cpg/astcreation/AstForExpressionsCreator.scala
@@ -386,8 +386,14 @@ trait AstForExpressionsCreator { this: AstCreator =>
           val receiverNode = createFieldAccessCallAst(baseNode, memberNode, elementLineNumber, elementColumnNumber)
           val thisPushNode = createIdentifierNode(tmpName, elementNodeInfo)
 
-          val argAsts = List(Ast(thisPushNode), elementNode)
-          Some(createCallAst(pushCallNode, argAsts, Some(receiverNode)))
+          Some(
+            createCallAst(
+              pushCallNode,
+              List(elementNode),
+              receiver = Some(receiverNode),
+              base = Some(Ast(thisPushNode))
+            )
+          )
         case _ => None // skip
       }
 


Test patch:
diff --git a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
index 020dcea10eb6..e4accd95dd27 100644
--- a/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
+++ b/joern-cli/frontends/jssrc2cpg/src/test/scala/io/joern/jssrc2cpg/passes/ast/SimpleAstCreationPassTest.scala
@@ -1527,19 +1527,15 @@ class SimpleAstCreationPassTest extends AbstractPassTest {
 
     val pushCallReceiverBase = pushCallReceiver.argument(1).asInstanceOf[Identifier]
     pushCallReceiverBase.name shouldBe "_tmp_0"
-    pushCallReceiverBase.argumentIndex shouldBe 1
 
     val pushCallReceiverMember = pushCallReceiver.argument(2).asInstanceOf[FieldIdentifier]
     pushCallReceiverMember.canonicalName shouldBe "push"
-    pushCallReceiverMember.argumentIndex shouldBe 2
 
-    val pushCallThis = pushCall.argument(1).asInstanceOf[Identifier]
+    val pushCallThis = pushCall.argument(0).asInstanceOf[Identifier]
     pushCallThis.name shouldBe "_tmp_0"
-    pushCallThis.argumentIndex shouldBe 1
 
-    val pushCallArg = pushCall.argument(2).asInstanceOf[Literal]
+    val pushCallArg = pushCall.argument(1).asInstanceOf[Literal]
     pushCallArg.code shouldBe element.toString
-    pushCallArg.argumentIndex shouldBe 2
   }
 
 }
Repository: swiftlang/swift-syntax (swift)

Issue:
`:` is not applied in the correct place for function signature Fix-It
### Description

https://github.com/apple/swift-syntax/pull/1549#discussion_r1179896824
Test case `testInvalid13`

### Steps to Reproduce

_No response_

Pull request:
# Goal

To solve issue https://github.com/apple/swift-syntax/issues/1608.

## Notes

There are some `TODOs` in the code I want to solve but I didn't know how. Any help is appreciated. Thank you.

Patch:
diff --git a/Sources/SwiftParser/Parameters.swift b/Sources/SwiftParser/Parameters.swift
index 83867b21b9a..f689060d75b 100644
--- a/Sources/SwiftParser/Parameters.swift
+++ b/Sources/SwiftParser/Parameters.swift
@@ -92,10 +92,30 @@ extension Parser {
     let modifiers = parseParameterModifiers(isClosure: false)
     let misplacedSpecifiers = parseMisplacedSpecifiers()
 
-    let names = self.parseParameterNames()
+    var names = self.parseParameterNames()
     let (unexpectedBeforeColon, colon) = self.expect(.colon)
 
-    let type = self.parseType(misplacedSpecifiers: misplacedSpecifiers)
+    let type: RawTypeSyntax
+
+    if colon.presence == .missing, let secondName = names.secondName, secondName.tokenText.isStartingWithUppercase {
+      // Synthesize the secondName parameter as a type node.
+      type = RawTypeSyntax(
+        RawSimpleTypeIdentifierSyntax(
+          name: secondName,
+          genericArgumentClause: nil,
+          arena: self.arena
+        )
+      )
+      names = ParameterNames(
+        unexpectedBeforeFirstName: names.unexpectedBeforeFirstName,
+        firstName: names.firstName,
+        unexpectedBeforeSecondName: nil,
+        secondName: nil
+      )
+    } else {
+      // Parse the type node as we would normally do.
+      type = self.parseType(misplacedSpecifiers: misplacedSpecifiers)
+    }
 
     let ellipsis = self.consumeIfContextualPunctuator("...", remapping: .ellipsis)
 


Test patch:
diff --git a/Tests/SwiftParserTest/translated/InvalidTests.swift b/Tests/SwiftParserTest/translated/InvalidTests.swift
index b411b4f91a6..e94655871e4 100644
--- a/Tests/SwiftParserTest/translated/InvalidTests.swift
+++ b/Tests/SwiftParserTest/translated/InvalidTests.swift
@@ -312,19 +312,19 @@ final class InvalidTests: XCTestCase {
       do {
         class Starfish {}
         struct Salmon {}
-        func f(s Starfish1️⃣,
+        func f(s 1️⃣Starfish,
                   _ ss: Salmon) -> [Int] {}
         func g() { f(Starfish(), Salmon()) }
       }
       """,
       diagnostics: [
-        DiagnosticSpec(message: "expected ':' and type in parameter", fixIts: ["insert ':' and type"])
+        DiagnosticSpec(message: "expected ':' in parameter", fixIts: ["insert ':'"])
       ],
       fixedSource: """
         do {
           class Starfish {}
           struct Salmon {}
-          func f(s Starfish: <#type#>,
+          func f(s: Starfish,
                     _ ss: Salmon) -> [Int] {}
           func g() { f(Starfish(), Salmon()) }
         }