Generating from ClassConcept with collections lang

In my ClassConcept I have

private final map<string, T> map = new hashmap<string, T>;
prettyPrint();

It generates
private final <!TextGen not found for 'jetbrains.mps.baseLanguage.collections.structure.MapType'!> map = new <!TextGen not found for 'jetbrains.mps.baseLanguage.collections.structure.HashMapCreator'!>;
prettyPrint();

I understand that I'm missing something, but what? Tried everything I was able to think of.
3 comments
Usually it happens when your language generates collections, but doesn't declare a dependency on collections language (in terms of mapping priorities). Collections language is reduced on an earlier step and collection statements produced by your language are left unprocessed. The solution is to add a priority rule that your mapping configuration <= collections.
0
Evgeny, thanks for the answer.
Is there any other way to ensure that collections can be used in generators?

The one you described works ok, but it looks very counter-intuitive for me. Usually "counter-intuitive" means "there is a better way".
0
Sometimes there is, sometimes there's not. We can determine which languages are produced by templates, but it is hard to bind templates to mapping configurations if there are more than one. It will work in simple cases, but it will harm you, when your generator becomes complex. I mean that you'll get unexpected implicit priorities, which is bad. That's why the question is still open..
0

Please sign in to leave a comment.