From 62a2e9f945e424567e9d9bb8896953e205f640d8 Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Fri, 17 Aug 2018 13:33:22 +0200 Subject: [PATCH] Report closest ancestor in overrides, not farthest, matching documentation. (#187) --- packages/jsii-calc/test/assembly.jsii | 10 +++---- .../.jsii | 10 +++---- packages/jsii-runtime/package-lock.json | 28 +++++-------------- packages/jsii/lib/compiler.ts | 10 +++++-- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 4606289318..ecdb75f4c4 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -208,7 +208,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -1569,7 +1569,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -1662,7 +1662,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -2745,7 +2745,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -2838,5 +2838,5 @@ } }, "version": "0.6.4", - "fingerprint": "w6KwhZtZH4/dMIvQlPb9nAIbic1GnqUVTSxVuf7TKbU=" + "fingerprint": "J/33pyDX7y9AI1Vizdu+HEO/87ED05WoSxg41CSYHtw=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii index 4606289318..ecdb75f4c4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii @@ -208,7 +208,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -1569,7 +1569,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -1662,7 +1662,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -2745,7 +2745,7 @@ }, "name": "toString", "overrides": { - "fqn": "@scope/jsii-calc-lib.Value" + "fqn": "@scope/jsii-calc-lib.Operation" }, "returns": { "primitive": "string" @@ -2838,5 +2838,5 @@ } }, "version": "0.6.4", - "fingerprint": "w6KwhZtZH4/dMIvQlPb9nAIbic1GnqUVTSxVuf7TKbU=" + "fingerprint": "J/33pyDX7y9AI1Vizdu+HEO/87ED05WoSxg41CSYHtw=" } diff --git a/packages/jsii-runtime/package-lock.json b/packages/jsii-runtime/package-lock.json index 72bc4420ae..e2c829d2d4 100644 --- a/packages/jsii-runtime/package-lock.json +++ b/packages/jsii-runtime/package-lock.json @@ -1976,13 +1976,11 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, - "optional": true + "bundled": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1995,18 +1993,15 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "concat-map": { "version": "0.0.1", - "bundled": true, - "optional": true + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, - "optional": true + "bundled": true }, "core-util-is": { "version": "1.0.2", @@ -2109,8 +2104,7 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, - "optional": true + "bundled": true }, "ini": { "version": "1.3.5", @@ -2120,7 +2114,6 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2133,20 +2126,17 @@ "minimatch": { "version": "3.0.4", "bundled": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true, - "optional": true + "bundled": true }, "minipass": { "version": "2.2.4", "bundled": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2163,7 +2153,6 @@ "mkdirp": { "version": "0.5.1", "bundled": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2236,8 +2225,7 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, - "optional": true + "bundled": true }, "object-assign": { "version": "4.1.1", @@ -2247,7 +2235,6 @@ "once": { "version": "1.4.0", "bundled": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2353,7 +2340,6 @@ "string-width": { "version": "1.0.2", "bundled": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/packages/jsii/lib/compiler.ts b/packages/jsii/lib/compiler.ts index ead713a4d7..111fee7346 100644 --- a/packages/jsii/lib/compiler.ts +++ b/packages/jsii/lib/compiler.ts @@ -1358,7 +1358,10 @@ function validateOverriddenSignatures(mod: spec.Assembly, externalTypes: Map