@abaplint/core 2.119.42 → 2.119.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,7 +132,8 @@ class FieldChain {
132
132
  if (allowGenericDeference === false
133
133
  && (context === null || context === void 0 ? void 0 : context.isGeneric()) === true
134
134
  && input.scope.getVersion() < version_1.Version.v756
135
- && input.scope.getVersion() !== version_1.Version.Cloud) {
135
+ && input.scope.getVersion() !== version_1.Version.Cloud
136
+ && input.scope.getVersion() !== version_1.Version.OpenABAP) {
136
137
  throw new Error("A generic reference cannot be dereferenced");
137
138
  }
138
139
  }
@@ -277,9 +277,23 @@ class Select {
277
277
  }
278
278
  }
279
279
  }
280
+ static countResultType(scope) {
281
+ if (scope.getVersion() >= version_1.Version.v750
282
+ || scope.getVersion() === version_1.Version.OpenABAP
283
+ || scope.getVersion() === version_1.Version.Cloud) {
284
+ return new basic_1.Integer8Type();
285
+ }
286
+ else {
287
+ return basic_1.IntegerType.get();
288
+ }
289
+ }
280
290
  static buildStructureType(fields, dbSources, scope) {
281
291
  var _a, _b, _c, _d, _e, _f;
282
292
  if (fields.length === 1 && dbSources.length === 1) {
293
+ // COUNT( * ) yields an integer regardless of the (possibly dynamic) table
294
+ if (/^count\(\s*\*\s*\)$/i.test(fields[0].code)) {
295
+ return this.countResultType(scope);
296
+ }
283
297
  const dbType = (_a = dbSources[0]) === null || _a === void 0 ? void 0 : _a.parseType(scope.getRegistry());
284
298
  if (dbType === undefined) {
285
299
  const name = ((_b = dbSources[0]) === null || _b === void 0 ? void 0 : _b.getName()) || "buildStructureTypeError";
@@ -299,16 +313,6 @@ class Select {
299
313
  if (field) {
300
314
  return field;
301
315
  }
302
- else if (fields[0].code === "COUNT(*)") {
303
- if (scope.getVersion() >= version_1.Version.v750
304
- || scope.getVersion() === version_1.Version.OpenABAP
305
- || scope.getVersion() === version_1.Version.Cloud) {
306
- return new basic_1.Integer8Type();
307
- }
308
- else {
309
- return basic_1.IntegerType.get();
310
- }
311
- }
312
316
  else {
313
317
  // todo: aggregated/calculated values
314
318
  return basic_1.VoidType.get("SELECT_todo11");
@@ -74,7 +74,7 @@ class Registry {
74
74
  }
75
75
  static abaplintVersion() {
76
76
  // magic, see build script "version.js"
77
- return "2.119.42";
77
+ return "2.119.43";
78
78
  }
79
79
  getDDICReferences() {
80
80
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.119.42",
3
+ "version": "2.119.43",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",