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)); } 

try it!

(type returns closed model, i. e. type arguments applied; can open declaration .declaration.)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -