In ceylon, how do I get Class object from a class? -
i have method takes java.lang.class object parameter. how ceylon class?
i.e. equivalent of someclass.class
in java.
for someclass.class
, use meta literal: `someclass`
closed model, `class someclass`
open declaration.
for someinstance.class
, can use type
function ceylon.language.meta
.
import ceylon.language.meta { type } class c() {} class d() extends c() {} shared void run() { c c = d(); print(type(c)); }
(type
returns closed model, i. e. type arguments applied; can open declaration .declaration
.)
Comments
Post a Comment