Skip to content

Commit 239895a

Browse files
committedJan 13, 2022
Use GenericComponentExtension to refer to wrapped generic comp extensions
1 parent d8b3097 commit 239895a

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed
 

‎components/context.jsonld

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@
141141
"@id": "oo:parameterRangeGenericBindings",
142142
"@type": "@id"
143143
},
144+
"GenericComponentExtension": {
145+
"@id": "oo:GenericComponentExtension"
146+
},
144147

145148
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
146149
"comment": {

‎lib/loading/ComponentRegistryFinalizer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class ComponentRegistryFinalizer {
5454
for (let superComponent of superComponents) {
5555
// Check if the super component is wrapped in a generic component instantiation
5656
if (superComponent.property.type?.value === this.objectLoader.contextResolved
57-
.expandTerm('oo:ParameterRangeGenericComponent')) {
57+
.expandTerm('oo:GenericComponentExtension')) {
5858
superComponent = superComponent.property.component;
5959
}
6060

‎lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class ParameterPropertyHandlerRange implements IParameterPropertyHandler
326326
for (const valueSuperType of [ ...value.properties.extends, ...value.properties.type ]) {
327327
// Special case: if the super component is wrapped in a generic component instantiation, unwrap it.
328328
if (valueSuperType.property.type?.value === this.objectLoader.contextResolved
329-
.expandTerm('oo:ParameterRangeGenericComponent')) {
329+
.expandTerm('oo:GenericComponentExtension')) {
330330
// First recursively continue calling hasType for the unwrapped component
331331
if (this.hasType(
332332
valueSuperType.property.component,

‎test/assets/module-paramranges-generics-nested-extends.jsonld

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"requireElement": "Hello",
7676
"extends": [
7777
{
78-
"@type": "ParameterRangeGenericComponent",
78+
"@type": "GenericComponentExtension",
7979
"component": "ex:HelloWorldModule#SayHelloComponentInnerAbstract",
8080
"genericTypeInstances": [
8181
"xsd:boolean"

‎test/unit/loading/ComponentRegistryFinalizer-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ describe('ComponentRegistryFinalizer', () => {
291291
],
292292
});
293293
const component2 = objectLoader.createCompactedResource({
294-
'@type': 'ParameterRangeGenericComponent',
294+
'@type': 'GenericComponentExtension',
295295
component: {
296296
'@id': 'ex:MyComponent2',
297297
types: 'oo:Class',

‎test/unit/preprocess/parameterproperty/ParameterPropertyHandlerRange-test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ describe('ParameterPropertyHandlerRange', () => {
14691469
'@type': {
14701470
'@id': 'ex:SomeType1',
14711471
extends: {
1472-
'@type': 'ParameterRangeGenericComponent',
1472+
'@type': 'GenericComponentExtension',
14731473
component: {
14741474
'@id': 'ex:SomeType2',
14751475
genericTypeParameters: [
@@ -1521,7 +1521,7 @@ describe('ParameterPropertyHandlerRange', () => {
15211521
'@type': {
15221522
'@id': 'ex:SomeType1',
15231523
extends: {
1524-
'@type': 'ParameterRangeGenericComponent',
1524+
'@type': 'GenericComponentExtension',
15251525
component: {
15261526
'@id': 'ex:SomeType2',
15271527
genericTypeParameters: [
@@ -1573,7 +1573,7 @@ describe('ParameterPropertyHandlerRange', () => {
15731573
'@type': {
15741574
'@id': 'ex:SomeType1',
15751575
extends: {
1576-
'@type': 'ParameterRangeGenericComponent',
1576+
'@type': 'GenericComponentExtension',
15771577
component: {
15781578
'@id': 'ex:SomeType2',
15791579
genericTypeParameters: [
@@ -1612,14 +1612,14 @@ describe('ParameterPropertyHandlerRange', () => {
16121612
const value = handler.captureType(
16131613
objectLoader.createCompactedResource({
16141614
'@type': {
1615-
'@type': 'ParameterRangeGenericComponent',
1615+
'@type': 'GenericComponentExtension',
16161616
component: {
16171617
'@id': 'ex:SomeType1',
16181618
genericTypeParameters: [
16191619
'ex:SomeType1__generic_T',
16201620
],
16211621
extends: {
1622-
'@type': 'ParameterRangeGenericComponent',
1622+
'@type': 'GenericComponentExtension',
16231623
component: {
16241624
'@id': 'ex:SomeType2',
16251625
genericTypeParameters: [
@@ -1659,7 +1659,7 @@ describe('ParameterPropertyHandlerRange', () => {
16591659
expect(value).toBeTruthy();
16601660
expectOutputProperties(value, objectLoader.createCompactedResource({
16611661
'@type': {
1662-
'@type': 'ParameterRangeGenericComponent',
1662+
'@type': 'GenericComponentExtension',
16631663
component: 'ex:SomeType1',
16641664
genericTypeInstances: [
16651665
{
@@ -1690,7 +1690,7 @@ describe('ParameterPropertyHandlerRange', () => {
16901690
'@type': {
16911691
'@id': 'ex:SomeType1',
16921692
extends: {
1693-
'@type': 'ParameterRangeGenericComponent',
1693+
'@type': 'GenericComponentExtension',
16941694
component: {
16951695
'@id': 'ex:SomeType2',
16961696
genericTypeParameters: [
@@ -1731,7 +1731,7 @@ describe('ParameterPropertyHandlerRange', () => {
17311731
'@type': {
17321732
'@id': 'ex:SomeType1',
17331733
extends: {
1734-
'@type': 'ParameterRangeGenericComponent',
1734+
'@type': 'GenericComponentExtension',
17351735
component: {
17361736
'@id': 'ex:SomeType2',
17371737
genericTypeParameters: [
@@ -1773,7 +1773,7 @@ describe('ParameterPropertyHandlerRange', () => {
17731773
'@type': {
17741774
'@id': 'ex:SomeType1',
17751775
extends: {
1776-
'@type': 'ParameterRangeGenericComponent',
1776+
'@type': 'GenericComponentExtension',
17771777
component: {
17781778
'@id': 'ex:SomeType2',
17791779
genericTypeParameters: [

0 commit comments

Comments
 (0)
Please sign in to comment.