If your question is about SonarLint in the IntelliJ Platform, VS Code, Visual Studio, or Eclipse, please post it in that sub-category.
Otherwise, please provide:
- Operating system: Mac
- IDE name and flavor/env: Xcode
And a thorough description of the problem / question:
the key problem is "" in swift kvo, cause error in sonar scan
kvo code sample:
observation = observe(
\.objectToObserve.myDate,
options: [.old, .new]
) { object, change in
print("myDate changed from: xxx")
}
logs:
[ERROR] Failed to analyze file xxx.swift
java.lang.RuntimeException: Exception during execution of merge for nonterminal KEY_PATH_EXPRESSION
at org.sonar.sslr.gll.grammar2.ProductionAction$Merge.run(Unknown Source)
at org.sonar.sslr.gll.grammar2.ProductionAction.setResultOrMerge(Unknown Source)
at org.sonar.sslr.gll.grammar2.ProductionAction$Call.execute(Unknown Source)
at org.sonar.sslr.gll.grammar2.ProductionAction$Call.execute(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.PackedNode.performGrammarActions(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.PackedNode.performGrammarActions(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.PackedNode.performGrammarActions(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.PackedNode.performGrammarActions(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.NonterminalNode.performGrammarActions(Unknown Source)
at org.sonar.sslr.gll.internal.sppf.PackedNode.performGrammarActionsForRightNodes(Unknown Source)
…
Caused by: com.sonarsource.swift.A: Unhandled ambiguity in PATTERN grammar rule at line 154 column 1
at com.sonarsource.swift.grammar.TreeFactory.disambiguateKeyPathExpression(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
… 76 common frames omitted