Skip to content

Commit

Permalink
applied member class ceylon/ceylon-js#196
Browse files Browse the repository at this point in the history
  • Loading branch information
chochos committed Oct 4, 2013
1 parent 646bf66 commit dee7a7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions runtime-js/appliedtypes.js
Expand Up @@ -10,10 +10,12 @@ function AppliedClass(tipo,$$targs$$,that){
that.tipo=function(){return tipo.apply(x,arguments);};
return that;
}
that.tipo$2=tipo;
var dummy = new AppliedClass.$$;
that.$$=AppliedClass.$$;
that.getT$all=function(){return dummy.getT$all();};
that.getT$name=function(){return dummy.getT$name();};
that.equals=function(o){return o && (o.tipo$2||o.tipo)==tipo;};
} else {
that=new AppliedClass.$$;
}
Expand Down Expand Up @@ -67,6 +69,9 @@ function $init$AppliedClass(){
throw wrapexc(Exception(String$("Class declaration",17)),'26:67-26:103','?');
};$$clase.isSuperTypeOf.$$metamodel$$=function(){return{mod:$$METAMODEL$$,$t:{t:Boolean},$ps:[{$nm:'type',$mt:'prm',$t:{t:Type$meta$model,a:{Type:{t:Anything}}},$an:function(){return[];}}],$cont:AppliedClass,$an:function(){return[shared(),actual()];},d:['ceylon.language.meta.model','Class','$m','isSuperTypeOf']};};

$$clase.equals=function(o){return o && (o.tipo$2||o.tipo)==tipo; };
//TODO equals metamodel

$$clase.isExactly=function isExactly(type$10){
var $$clase=this;
throw wrapexc(Exception(String$("Class declaration",17)),'27:63-27:99','?');
Expand Down Expand Up @@ -281,6 +286,7 @@ function AppliedFunction(m,$$targs$$,o) {
}
return f;
}
AppliedFunction.$$metamodel$$=function(){return{mod:$$METAMODEL$$,d:['ceylon.language.meta.model','Function'],satisfies:{t:Function$meta$model,a:{Type:'Type',Arguments:'Arguments'}},$an:function(){return [shared(),actual()];}};};
exports.AppliedFunction$meta$model=AppliedFunction;

function AppliedValue(obj,attr,$$targs$$,$$appliedValue){
Expand Down
6 changes: 3 additions & 3 deletions runtime-js/metamodel.js
Expand Up @@ -37,11 +37,11 @@ function typeLiteral$meta($$targs$$) {
}
var mdl = get_model(mm);
if (mdl['$mt'] === 'cls') {
return AppliedClass(t,mdl['$tp']);
return AppliedClass(t,mdl['$tp'],{Type:$$targs$$.Type,Arguments:{t:Nothing}});
} else if (mdl['$mt'] === 'ifc') {
return AppliedInterface(t,mdl['$tp']);
return AppliedInterface(t,mdl['$tp'],$$targs$$);
} else if (mdl['$mt'] === 'mthd') {
return AppliedFunction(t);
return AppliedFunction(t,{Type:$$targs$$.Type,Arguments:{t:Nothing}});
} else if (mdl['$mt'] === 'attr' || mdl['$mt'] === 'gttr' || mdl['$mt'] === 'obj') {
return AppliedValue(undefined,t,{Container:{t:mm.$cont},Type:mm.$t});
} else {
Expand Down

0 comments on commit dee7a7b

Please sign in to comment.