Uploaded image for project: 'SonarPython'
  1. SonarPython
  2. SONARPY-625

Exception thrown when highlighting symbols in nested f-string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8
    • Component/s: Parser
    • Labels:
      None

      Description

      When analyzing the following code:

      42
      def foo(x):
          return x
      f'{foo(f"{foo}->{42}")}'
      

      an exception is raised:

      java.lang.IllegalArgumentException: Unable to create symbol on file nested-fstring.py
      	at org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable.newSymbol(DefaultSymbolTable.java:71)
      	at org.sonar.plugins.python.SymbolVisitor.handleSymbol(SymbolVisitor.java:92)
      	at java.lang.Iterable.forEach(Iterable.java:75)
      
      

        Attachments

          Activity

            People

            Assignee:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Reporter:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: