Skip to content

Spurious static error for char(_) parse Tree and annotation setting #2342

@jurgenvinju

Description

@jurgenvinju

Describe the bug

Tree buggyFunc() {
  return char(10)[@\loc=|unknown:///|]; 
} 

This produces:

Invalid type: expected node, ADT, or concrete syntax types, found ![]

It looks like the \char-class type of the char(10) expression, which is either [\n] or ![], has not been added to the possible receivers of annotation setting [@anno=exp] yet.

I worked around this in ParseTree.rsc by "upcasting" to Tree statically, but the code would look better without that workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions