object literal supported
This commit is contained in:
@@ -30,7 +30,7 @@ public class NewClassExpression extends Expression {
|
|||||||
final String callOperator = myQualifier.isNullable() ? QUESTDOT : DOT;
|
final String callOperator = myQualifier.isNullable() ? QUESTDOT : DOT;
|
||||||
final String qualifier = myQualifier.isEmpty() ? EMPTY : myQualifier.toKotlin() + callOperator;
|
final String qualifier = myQualifier.isEmpty() ? EMPTY : myQualifier.toKotlin() + callOperator;
|
||||||
return myAnonymousClass != null ?
|
return myAnonymousClass != null ?
|
||||||
qualifier + myName.toKotlin() + "(" + myArguments.toKotlin() + ")" + myAnonymousClass.toKotlin() :
|
"object" + SPACE + ":" + SPACE + qualifier + myName.toKotlin() + "(" + myArguments.toKotlin() + ")" + myAnonymousClass.toKotlin() :
|
||||||
qualifier + myName.toKotlin() + "(" + myArguments.toKotlin() + ")";
|
qualifier + myName.toKotlin() + "(" + myArguments.toKotlin() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package demo;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.*;
|
||||||
|
|
||||||
|
public final class Client extends Frame {
|
||||||
|
Client() {
|
||||||
|
WindowAdapter a = new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing (WindowEvent e) {
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addWindowListener(a);
|
||||||
|
|
||||||
|
addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing (WindowEvent e) {
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
namespace demo {
|
||||||
|
import java.awt.*
|
||||||
|
import java.awt.event.*
|
||||||
|
import java.io.*
|
||||||
|
import java.net.*
|
||||||
|
public class Client() : Frame() {
|
||||||
|
{
|
||||||
|
var a : WindowAdapter? = object : WindowAdapter() {
|
||||||
|
open public fun windowClosing(e : WindowEvent?) : Unit {
|
||||||
|
dispose()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
addWindowListener(a)
|
||||||
|
addWindowListener(object : WindowAdapter() {
|
||||||
|
open public fun windowClosing(e : WindowEvent?) : Unit {
|
||||||
|
dispose()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user