antlr / antlr/stringtemplate4

Cannot override template referenced from dictionary value

Open
#171 0 comments 0 reactions 0 assignees View on GitHub
type:bug
Dominant language
Java
Stars
1k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

## Steps to reproduce

### Base.stg

```
Map ::= [
"a": {}
]

example() ::= "override this"
```

### Derived.stg

```
import "Base.stg"

main() ::= <<

>>

example() ::= "custom"
```

### Code

```java
STGroup group = new STGroupFile("Derived.stg");
ST template = group.getInstanceOf("a");
template.render();
```

## Expected result

```
custom
```

## Actual result

```
override this
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the Base.stg and Derived.stg reproducer, then trace the Java entry points STGroupFile, getInstanceOf, and render. Confirm that rendering the dictionary value currently produces "override this" and that done means it produces the derived template's "custom" output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.