Add a "new" keyword for constructing nullable methodmaps.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
methodmap Handle __nullable__
|
||||
{
|
||||
public native ~Handle();
|
||||
};
|
||||
|
||||
public t()
|
||||
{
|
||||
Handle egg = new Handle();
|
||||
delete egg;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
(8) : error 172: methodmap 'Handle' does not have a constructor
|
||||
@@ -0,0 +1,13 @@
|
||||
methodmap Handle __nullable__
|
||||
{
|
||||
public native Handle();
|
||||
public native ~Handle();
|
||||
};
|
||||
|
||||
enum Crab {};
|
||||
|
||||
public t()
|
||||
{
|
||||
Crab egg = new Crab();
|
||||
delete egg;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
(11) : error 116: no methodmap or class was found for Crab
|
||||
@@ -0,0 +1,11 @@
|
||||
methodmap Handle
|
||||
{
|
||||
public native Handle();
|
||||
public native ~Handle();
|
||||
};
|
||||
|
||||
public t()
|
||||
{
|
||||
Handle egg = new Handle();
|
||||
delete egg;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
(9) : error 171: cannot use 'new' with non-object-like methodmap 'Handle'
|
||||
@@ -0,0 +1,11 @@
|
||||
methodmap Handle __nullable__
|
||||
{
|
||||
public native Handle();
|
||||
public native ~Handle();
|
||||
};
|
||||
|
||||
public t()
|
||||
{
|
||||
Handle egg = Handle();
|
||||
delete egg;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
(9) : error 170: creating new object 'Handle' requires using 'new' before its constructor
|
||||
@@ -0,0 +1,15 @@
|
||||
native void printnum(int num);
|
||||
|
||||
methodmap Handle __nullable__
|
||||
{
|
||||
public Handle() {
|
||||
return Handle:2;
|
||||
}
|
||||
public native ~Handle();
|
||||
};
|
||||
|
||||
public main()
|
||||
{
|
||||
Handle egg = new Handle();
|
||||
printnum(_:egg);
|
||||
}
|
||||
Reference in New Issue
Block a user