Skip to content
Tcl Source Code Artifact [55b26e81c3]
Login

Artifact [55b26e81c3]

Artifact 55b26e81c399ff692e602e127ede6349ea4a356a3859e1c91da3a1422930751a:


-- côté nom : set {A}y valeur
N1    ok: mm
N2    ERREUR: expected floating-point number but got "abc"
N3    ERREUR: unknown type "zz"
N4    ERREUR: local annotation {-v} cannot declare a variable: a variable name takes a type
N5    ERREUR: missing close-parenthesis
in type "int("
N6    ok: px
N7    ok: {} xyz
N8    ok: Shape/circle
-- côté valeur, variable libre : set y {A}$x
V1    ok: 
V2    ok: mm
V3    ERREUR: expected floating-point number but got "abc"
V4    ERREUR: unknown type "zz": an annotation on a value received by a constructor must be a known type
V5    ok: {} 5
V6    ok: {} abc
V7    ERREUR: unknown type "hello": an annotation on a value received by a constructor must be a known type
V8    ERREUR: unknown type "circle": an annotation on a value received by a constructor must be a known type
V9    ERREUR: unknown type "mm9": an annotation on a value received by a constructor must be a known type
V10   ok: @mm10
V11   ok: @dist11,mm11
V11b  ok: @mm,px,stop
V12   ok: @px,qq
V12b  ok: 100
V13   ERREUR: type mismatch: the value is mm, the annotation says px (an annotation does not convert: use type cast px)
-- côté valeur, variable typée : le contrat
C1    ERREUR: unknown type "zzpx": an annotation on a value received by a constructor must be a known type
C2    ok: int
C3    ok: int
C4    ok: double
C5    ok: mm
C6    ok: double
C7    ERREUR: type mismatch: expected dist but got mm (use an explicit cast)
C8    ERREUR: type mismatch: expected mm but got px (use an explicit cast)
C9    ERREUR: type mismatch: expected mm but got double (use an explicit cast)
C10   ok: mm
C11   ERREUR: unknown type "zz": an annotation on a value received by a constructor must be a known type
C12   ERREUR: type mismatch: expected mm but got px (use an explicit cast)
C13   ok: Shape/circle
C14   ERREUR: type mismatch: expected int(u,8) but got int (use an explicit cast)
-- casts
K1    ERREUR: type mismatch: the value is mm, the annotation says kg (an annotation does not convert: use type cast kg)
K2    ERREUR: type mismatch: the value is mm, the annotation says int (an annotation does not convert: use type cast int)
K3    ERREUR: value "70000" does not fit in port
K4    ERREUR: expected floating-point number but got "a b"
K5    ERREUR: type mismatch: the value is px, the annotation says mm (an annotation does not convert: use type cast mm)
-- hors constructeur
H1    ok: {} px abc
H2    ok: {} px
H3    ok: {} mm {}
H4    ok: @mm
H4b   ok: @mm
H5    ok: mm@zz
H6    ok: @mm
H7    ok: mm
H8    ERREUR: unknown type "zz": an annotation on a value received by a constructor must be a known type
-- l'annotation vide {}
E-nu  ok: nom= libre= typée=mm hors=
E-mm@ ok: nom= libre= typée=mm hors=
E-@zz ok: nom=@zz libre=@zz typée=mm@zz hors=
E-@px ok: nom=@px4 libre=@px4 typée=mm@px4 hors=
E-mm@zz ok: nom=@zz libre=@zz typée=mm@zz hors=
E-mm@px ok: nom=@px6 libre=@px6 typée=mm@px6 hors=
E-suite ok: pxs {} {}
-- type cast
TC1   ok: px
TC2   ERREUR: unknown way to cast the value from mm to kg
TC3   ERREUR: unknown type "zz"
TC4   ERREUR: expected integer but got "abc"
-- paramètres fantômes : des unités (le paramètre distingue les instances)
F1    ok: ok
F2    ok: mmF 1500.0 3000.0
F3    ERREUR: type mismatch: expected m but got mmF (use an explicit cast)
F4    ERREUR: type mismatch: the value is mmF, the annotation says kgF (an annotation does not convert: use type cast kgF)
F5    ERREUR: type mismatch: expected energie but got couple (use an explicit cast)
F6    ok: double
F7    ok: grandeur(L,1.0,0.0)
F8    ERREUR: parameter "u" is never used in the definition of ga
F9    ERREUR: type mismatch: the value is mmF, the annotation says m (an annotation does not convert: use type cast m)