Skip to content

Commit

Permalink
Work on #196
Browse files Browse the repository at this point in the history
  • Loading branch information
chochos committed Jul 24, 2013
1 parent 51c176b commit bb75567
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -94,6 +94,9 @@ void generateInvocation(Tree.InvocationExpression that) {
if (!argList.getPositionalArguments().isEmpty()) {
gen.out(",");
}
} else if (that.getPrimary().getTypeModel().getDeclaration().inherits(gen.getTypeUtils().metaClass)) {
//metamodel Classes are AppliedClass$metamodel which contains "tipo", a ref to the actual class
gen.out(".tipo(");
} else {
gen.out("(");
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/redhat/ceylon/compiler/js/TypeUtils.java
Expand Up @@ -35,6 +35,7 @@ public class TypeUtils {
final TypeDeclaration anything;
final TypeDeclaration callable;
final TypeDeclaration empty;
final TypeDeclaration metaClass;

TypeUtils(Module languageModule) {
com.redhat.ceylon.compiler.typechecker.model.Package pkg = languageModule.getPackage("ceylon.language");
Expand All @@ -48,6 +49,8 @@ public class TypeUtils {
anything = (TypeDeclaration)pkg.getMember("Anything", null, false);
callable = (TypeDeclaration)pkg.getMember("Callable", null, false);
empty = (TypeDeclaration)pkg.getMember("Empty", null, false);
pkg = languageModule.getPackage("ceylon.language.metamodel");
metaClass = (TypeDeclaration)pkg.getMember("Class", null, false);
}

/** Prints the type arguments, usually for their reification. */
Expand Down

0 comments on commit bb75567

Please sign in to comment.