Skip to content

ASTCreator cannot handle lists of strings #8

@peterwvj

Description

@peterwvj

Given the tree specification below:

Packages
base demo.ast;
analysis demo.analysis;

Tokens

java_String = 'java:java.lang.String';

Abstract Syntax Tree

Top {-> package='demo.ast.nodes'}
  = {test} [field]:java_String*
  ;

Aspect Declaration

The code produced by ASTCreator does not compile since there seems to be a problem with the way that the tool handles lists of strings. The compilation errors are:

[ERROR] /home/peter/dev/playground/string-bug/target/generated-sources/astCreator/demo/ast/nodes/ATestTop.java:[114,25] no suitable method found for cloneListExternal(java.util.List<capture#1 of ? extends java.lang.String>)
    method demo.ast.Node.<T>cloneListExternal(java.util.List<T>,java.util.Map<demo.ast.INode,demo.ast.INode>) is not applicable
      (cannot instantiate from arguments because actual and formal argument lists differ in length)
    method demo.ast.Node.<T>cloneListExternal(java.util.List<T>) is not applicable
      (inferred type does not conform to declared bound(s)
        inferred: capture#1 of ? extends java.lang.String
        bound(s): demo.ast.ExternalNode)
[ERROR] /home/peter/dev/playground/string-bug/target/generated-sources/astCreator/demo/ast/nodes/ATestTop.java:[146,25] no suitable method found for cloneListExternal(java.util.List<capture#2 of ? extends java.lang.String>,java.util.Map<demo.ast.INode,demo.ast.INode>)
    method demo.ast.Node.<T>cloneListExternal(java.util.List<T>,java.util.Map<demo.ast.INode,demo.ast.INode>) is not applicable
      (inferred type does not conform to declared bound(s)
        inferred: capture#2 of ? extends java.lang.String
        bound(s): demo.ast.ExternalNode)
    method demo.ast.Node.<T>cloneListExternal(java.util.List<T>) is not applicable
      (cannot instantiate from arguments because actual and formal argument lists differ in length)

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