Skip to content
Commit 71d1bfab authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Fix "Python class functions return value wrong in class widget"

umbrello/codeimport/nativeimportbase.{h,cpp}
- New function current() acts as shorthand for m_source[m_srcIndex].

umbrello/codeimport/pythonimport.{h,cpp}
- At function skipBody change type of argument foundReturn to
  Uml::PrimitiveTypes::Enum. For details see function documentation.

umbrello/codeimport/pythonimport.cpp
- In function fillSource, if first character is '-' then
  - if next character is '>' then append type hint token in m_source
    and shift the loop start index to 2;
  - else if next character is a digit then put the two characters to
    lexeme (start of negative number) and shift loop start index to 2.
- In function skipBody handling of token "return" decode following token
  into one of the Uml::PrimitiveTypes::Enum values Boolean, Integer,
  Real, or String.  If no "return" statement is encountered then set
  *foundReturn to Reserved.
- In functions parseInitializer and parseMethodParameters, on handling
  type string use Python type "str".
- In function parseStmt, if type hint exists then set returnTypeName
  from the type hint; otherwise decode foundReturn as returned by
  skipBody() to returnTypeName.

BUG: 449462
FIXED-IN:2.33.80 (KDE releases 22.03.80)
parent 03c359bd
Pipeline #131750 passed with stage
in 15 minutes and 11 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment