@@ -174,7 +174,7 @@ Uses special rules for `elsa-type-mixed'.
174
174
(cl-defmethod elsa-type-get-return ((this elsa-type))
175
175
this)
176
176
177
- (cl-defmethod elsa-type-accept ((this elsa-type) other &optional explainer)
177
+ (cl-defmethod elsa-type-accept ((this elsa-type) ( other elsa-type) &optional explainer)
178
178
" Test if THIS type accepts OTHER.
179
179
180
180
Accepting in this context means that OTHER can be assigned to
@@ -231,7 +231,7 @@ empty.")
231
231
(cl-defmethod elsa-type-describe ((_this elsa-type-empty))
232
232
" empty" )
233
233
234
- (cl-defmethod elsa-type-accept ((this elsa-type-empty) other &optional explainer)
234
+ (cl-defmethod elsa-type-accept ((this elsa-type-empty) ( other elsa-type) &optional explainer)
235
235
(if (elsa-type-composite-p other)
236
236
(elsa-type-is-accepted-by other this explainer)
237
237
(elsa-with-explainer explainer
@@ -282,7 +282,7 @@ of them.")
282
282
(oset new types types)
283
283
new))
284
284
285
- (cl-defmethod elsa-type-accept ((this elsa-intersection-type) other &optional explainer)
285
+ (cl-defmethod elsa-type-accept ((this elsa-intersection-type) ( other elsa-type) &optional explainer)
286
286
(elsa-with-explainer explainer
287
287
(elsa--fmt-explain-type-0-does-not-accept-type-1
288
288
(elsa-tostring this) (elsa-tostring other))
@@ -339,7 +339,7 @@ because the actual type can be any of them.")
339
339
(oset new types types)
340
340
new))
341
341
342
- (cl-defmethod elsa-type-accept ((this elsa-sum-type) other &optional explainer)
342
+ (cl-defmethod elsa-type-accept ((this elsa-sum-type) ( other elsa-type) &optional explainer)
343
343
(cond
344
344
((elsa-type-composite-p other)
345
345
(elsa-type-is-accepted-by other this explainer))
@@ -396,7 +396,7 @@ type and none of the negative types.")
396
396
(oset new negative negative)
397
397
new))
398
398
399
- (cl-defmethod elsa-type-accept ((this elsa-diff-type) other &optional explainer)
399
+ (cl-defmethod elsa-type-accept ((this elsa-diff-type) ( other elsa-type) &optional explainer)
400
400
(elsa-with-explainer explainer
401
401
(elsa--fmt-explain-type-0-does-not-accept-type-1
402
402
(elsa-tostring this) (elsa-tostring other))
@@ -845,7 +845,7 @@ then this is a supertype of other."
845
845
(mapconcat 'elsa-type-describe (oref this args) " " )
846
846
(elsa-type-describe (oref this return))))
847
847
848
- (cl-defmethod elsa-type-accept ((this elsa-function-type) other &optional explainer)
848
+ (cl-defmethod elsa-type-accept ((this elsa-function-type) ( other elsa-type) &optional explainer)
849
849
(if (elsa-type-composite-p other)
850
850
(elsa-type-is-accepted-by other this explainer)
851
851
(if (elsa-function-type-p other)
@@ -1035,7 +1035,7 @@ predefined value.")
1035
1035
(cl-defmethod elsa-type-describe ((this elsa-const-type))
1036
1036
(format " (const %S ) " (oref this value)))
1037
1037
1038
- (cl-defmethod elsa-type-accept ((this elsa-const-type) other &optional explainer)
1038
+ (cl-defmethod elsa-type-accept ((this elsa-const-type) ( other elsa-type) &optional explainer)
1039
1039
" The const type is different from readonly in that a readonly
1040
1040
type can never be assigned to but a const type is only a
1041
1041
narrowing of a type to a concrete value from the type's domain.
@@ -1063,7 +1063,7 @@ to this value."
1063
1063
It wraps any other type and makes the form or variable
1064
1064
unassignable." )
1065
1065
1066
- (cl-defmethod elsa-type-accept ((this elsa-readonly-type) other &optional explainer)
1066
+ (cl-defmethod elsa-type-accept ((this elsa-readonly-type) ( other elsa-type) &optional explainer)
1067
1067
" Check if this readonly type accept other type.
1068
1068
1069
1069
The acceptance does not depend on the readonly status. Here we
@@ -1100,7 +1100,7 @@ trying to analyse 'nil, which is not a valid type or form."
1100
1100
(when-let ((class (get (oref this name) 'elsa-defstruct )))
1101
1101
(elsa-get-slot class name)))
1102
1102
1103
- (cl-defmethod elsa-type-accept ((this elsa-struct-type) other &optional explainer)
1103
+ (cl-defmethod elsa-type-accept ((this elsa-struct-type) ( other elsa-type) &optional explainer)
1104
1104
(cond
1105
1105
((elsa-type-composite-p other)
1106
1106
(elsa-type-is-accepted-by other this explainer))
@@ -1142,7 +1142,7 @@ trying to analyse 'nil, which is not a valid type or form."
1142
1142
(when-let ((class (get (oref this name) 'elsa-defclass )))
1143
1143
(elsa-get-slot class name)))
1144
1144
1145
- (cl-defmethod elsa-type-accept ((this elsa-class-type) other &optional explainer)
1145
+ (cl-defmethod elsa-type-accept ((this elsa-class-type) ( other elsa-type) &optional explainer)
1146
1146
(cond
1147
1147
((elsa-type-composite-p other)
1148
1148
(elsa-type-is-accepted-by other this explainer))
@@ -1203,7 +1203,7 @@ symbol represents. During checking, we will try to forward to
1203
1203
(cl-defmethod elsa-type-describe ((this elsa-type--cl-ref))
1204
1204
(format " (cl-ref %s ) " (oref this name)))
1205
1205
1206
- (cl-defmethod elsa-type-accept ((this elsa-type--cl-ref) other &optional explainer)
1206
+ (cl-defmethod elsa-type-accept ((this elsa-type--cl-ref) ( other elsa-type) &optional explainer)
1207
1207
(elsa-type-accept (elsa-type--resolve-cl-ref this) other explainer))
1208
1208
1209
1209
(cl-defmethod elsa-type-accept ((this elsa-class-type) (other elsa-type--cl-ref) &optional explainer)
0 commit comments