Skip to content

More detailed error messages #118

@xterao

Description

@xterao

Add a message for each error case in code inspection.
Candidates are as follows:

  • The type of the for item definition source is not Iterable.
  • Incorrect field or method call when calling a static property
    ...etc

When an element name defined by a for directive conflicts with a DAO parameter name, the for directive’s definition must take precedence. Additionally, the DAO-parameter usage checker should detect cases where a parameter name:

  • Does not appear anywhere outside the for directive block, and
  • Matches an element name defined inside that block

—and in such cases emit a dedicated error message.

  @Select
  User select(User member);
-- The "member" used below uses the element defined in the for directive, so the Dao parameter side will have an error.
/*%for member : @example.entity.ProjectDetail@members*/
 /*%for project :  member.employee.projects */
     id = /* member.id */1
   /*%end */
/*%end */
-- "member" used outside the for directive does not cause an error because it refers to a Dao parameter.
WHERE id = /* member.userId */0
AND
/*%for member : @example.entity.ProjectDetail@members*/
 /*%for project :  member.employee.projects */
     id = /* member.id */1
   /*%end */
/*%end */

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions