diff --git a/packages/jsii-calc-base/test/assembly.jsii b/packages/jsii-calc-base/test/assembly.jsii
index e3781d4f3f..b0a58aa10c 100644
--- a/packages/jsii-calc-base/test/assembly.jsii
+++ b/packages/jsii-calc-base/test/assembly.jsii
@@ -72,6 +72,7 @@
},
"name": "typeName",
"returns": {
+ "optional": true,
"primitive": "any"
}
}
@@ -101,5 +102,5 @@
}
},
"version": "0.7.5",
- "fingerprint": "Kzm7bNzxYO6frB7BwjqVBKhzTiCRwVG5aqgQrz7MOnE="
+ "fingerprint": "kazFxdH9DydCwjHvToTbXzqqXE0CytJ5qNmGO1NlGAM="
}
diff --git a/packages/jsii-calc/lib/compliance.ts b/packages/jsii-calc/lib/compliance.ts
index 112921793d..09990ed8af 100644
--- a/packages/jsii-calc/lib/compliance.ts
+++ b/packages/jsii-calc/lib/compliance.ts
@@ -244,6 +244,10 @@ export class RuntimeTypeChecking {
public methodWithDefaultedArguments(arg1: number = 2, arg2: string, arg3: Date = new Date()) {
arg1; arg2; arg3;
}
+
+ public methodWithOptionalAnyArgument(arg?: any) {
+ arg;
+ }
}
export class OptionalConstructorArgument {
@@ -479,6 +483,7 @@ export interface DerivedStruct extends MyFirstStruct {
bool: boolean
anotherRequired: Date
optionalArray?: string[]
+ optionalAny?: any
/**
* This is optional.
*/
diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii
index a2c2a938a0..f424f819c2 100644
--- a/packages/jsii-calc/test/assembly.jsii
+++ b/packages/jsii-calc/test/assembly.jsii
@@ -377,6 +377,7 @@
"type": {
"collection": {
"elementtype": {
+ "optional": true,
"primitive": "any"
},
"kind": "array"
@@ -388,18 +389,13 @@
"type": {
"collection": {
"elementtype": {
+ "optional": true,
"primitive": "any"
},
"kind": "map"
}
}
},
- {
- "name": "anyProperty",
- "type": {
- "primitive": "any"
- }
- },
{
"name": "arrayProperty",
"type": {
@@ -521,6 +517,7 @@
"type": {
"collection": {
"elementtype": {
+ "optional": true,
"primitive": "any"
},
"kind": "array"
@@ -532,6 +529,7 @@
"type": {
"collection": {
"elementtype": {
+ "optional": true,
"primitive": "any"
},
"kind": "map"
@@ -539,8 +537,9 @@
}
},
{
- "name": "unknownProperty",
+ "name": "anyProperty",
"type": {
+ "optional": true,
"primitive": "any"
}
},
@@ -550,6 +549,13 @@
"fqn": "jsii-calc.StringEnum",
"optional": true
}
+ },
+ {
+ "name": "unknownProperty",
+ "type": {
+ "optional": true,
+ "primitive": "any"
+ }
}
]
},
@@ -1152,6 +1158,14 @@
"optional": true
}
},
+ {
+ "abstract": true,
+ "name": "optionalAny",
+ "type": {
+ "optional": true,
+ "primitive": "any"
+ }
+ },
{
"abstract": true,
"name": "optionalArray",
@@ -2403,6 +2417,18 @@
}
]
},
+ {
+ "name": "methodWithOptionalAnyArgument",
+ "parameters": [
+ {
+ "name": "arg",
+ "type": {
+ "optional": true,
+ "primitive": "any"
+ }
+ }
+ ]
+ },
{
"docs": {
"comment": "Used to verify verification of number of method arguments."
@@ -2854,6 +2880,7 @@
{
"name": "value",
"returns": {
+ "optional": true,
"primitive": "any"
}
}
@@ -3203,5 +3230,5 @@
}
},
"version": "0.7.5",
- "fingerprint": "PrLv57d+5ukv/bps1DvjB9DpM5DS6TpCEld13gQUTe8="
+ "fingerprint": "Zt3ElcP9k7ABYhwmP1xNZBni1sFj9iw0FZwWOe8n+L8="
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii
index e3781d4f3f..b0a58aa10c 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/.jsii
@@ -72,6 +72,7 @@
},
"name": "typeName",
"returns": {
+ "optional": true,
"primitive": "any"
}
}
@@ -101,5 +102,5 @@
}
},
"version": "0.7.5",
- "fingerprint": "Kzm7bNzxYO6frB7BwjqVBKhzTiCRwVG5aqgQrz7MOnE="
+ "fingerprint": "kazFxdH9DydCwjHvToTbXzqqXE0CytJ5qNmGO1NlGAM="
}
diff --git a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs
index c38472e6b3..83224daeac 100644
--- a/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs
+++ b/packages/jsii-pacmak/test/expected.jsii-calc-base/dotnet/Amazon.JSII.Tests.CalculatorPackageId.BasePackageId/Amazon/JSII/Tests/CalculatorNamespace/BaseNamespace/Base.cs
@@ -19,7 +19,7 @@ protected Base(DeputyProps props): base(props)
}
/// the name of the class (to verify native type names are created for derived classes).
- [JsiiMethod("typeName", "{\"primitive\":\"any\"}", "[]")]
+ [JsiiMethod("typeName", "{\"primitive\":\"any\",\"optional\":true}", "[]")]
public virtual object TypeName()
{
return InvokeInstanceMethod