@abaplint/core 2.120.11 → 2.120.13

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.
@@ -79,6 +79,16 @@ class TypeUtils {
79
79
  }
80
80
  return false;
81
81
  }
82
+ isCharLikeField(type) {
83
+ return type instanceof basic_1.CharacterType
84
+ || type instanceof basic_1.NumericType
85
+ || type instanceof basic_1.DateType
86
+ || type instanceof basic_1.TimeType
87
+ || type instanceof basic_1.CLikeType
88
+ || type instanceof basic_1.AnyType
89
+ || type instanceof basic_1.UnknownType
90
+ || type instanceof basic_1.VoidType;
91
+ }
82
92
  isCharLike(type) {
83
93
  if (type === undefined) {
84
94
  return false;
@@ -106,7 +106,11 @@ class ValueBody {
106
106
  field_assignment_1.FieldAssignment.runSyntax(s, input, rowType);
107
107
  }
108
108
  for (const s of foo.findDirectExpressions(Expressions.Source)) {
109
- source_1.Source.runSyntax(s, input, rowType);
109
+ const sourceType = source_1.Source.runSyntax(s, input, rowType);
110
+ if (rowType instanceof basic_1.StringType && sourceType instanceof basic_1.CharacterType) {
111
+ const message = "VALUE, source type CharacterType not compatible with StringType";
112
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
113
+ }
110
114
  }
111
115
  }
112
116
  if (letScoped === true) {
@@ -68,7 +68,11 @@ class Write {
68
68
  }
69
69
  const target = node.findDirectExpression(Expressions.Target);
70
70
  if (target) {
71
- target_1.Target.runSyntax(target, input);
71
+ const targetType = target_1.Target.runSyntax(target, input);
72
+ if (new _type_utils_1.TypeUtils(input.scope).isCharLikeField(targetType) === false) {
73
+ const message = `"${target.concatTokens()}" must be a character-like field (data type C, N, D, or T, got "${targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name}")`;
74
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, target.getFirstToken(), message));
75
+ }
72
76
  }
73
77
  }
74
78
  }
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.11";
78
+ return "2.120.13";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
@@ -104,7 +104,11 @@ class NoMandtInDatabaseOperations extends _abap_rule_1.ABAPRule {
104
104
  }
105
105
  findMandtInCondition(statement) {
106
106
  for (const condition of statement.findAllExpressions(Expressions.SQLCond)) {
107
- for (const field of condition.findAllExpressions(Expressions.SQLFieldName)) {
107
+ const fields = condition.findAllExpressionsMulti([
108
+ Expressions.SQLFieldName,
109
+ Expressions.SQLAliasField,
110
+ ]);
111
+ for (const field of fields) {
108
112
  const name = field.concatTokens().toUpperCase();
109
113
  if (name === "MANDT" || name.endsWith("~MANDT")) {
110
114
  return field;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.11",
3
+ "version": "2.120.13",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",