File tree Expand file tree Collapse file tree 5 files changed +161
-30
lines changed Expand file tree Collapse file tree 5 files changed +161
-30
lines changed Original file line number Diff line number Diff line change @@ -1233,10 +1233,14 @@ pub(crate) async fn inner_close(
1233
1233
args : Args ,
1234
1234
) -> Result < Sketch , KclError > {
1235
1235
if sketch. is_closed {
1236
- return Err ( KclError :: new_semantic ( KclErrorDetails :: new (
1237
- "This sketch is already closed. Remove this unnecessary `close()` call" . to_owned ( ) ,
1238
- vec ! [ args. source_range] ,
1239
- ) ) ) ;
1236
+ exec_state. warn ( crate :: CompilationError {
1237
+ source_range : args. source_range ,
1238
+ message : "This sketch is already closed. Remove this unnecessary `close()` call" . to_string ( ) ,
1239
+ suggestion : None ,
1240
+ severity : crate :: errors:: Severity :: Warning ,
1241
+ tag : crate :: errors:: Tag :: Unnecessary ,
1242
+ } ) ;
1243
+ return Ok ( sketch) ;
1240
1244
}
1241
1245
let from = sketch. current_pen_position ( ) ?;
1242
1246
let to = point_to_len_unit ( sketch. start . get_from ( ) , from. units ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ -- -
2
+ source : kcl - lib / src / simulation_tests .rs
3
+ description : Execution success double_close .kcl
4
+ -- -
5
+ null
Original file line number Diff line number Diff line change 2
2
source : kcl - lib / src / simulation_tests .rs
3
3
description : Variables in memory after executing double_close .kcl
4
4
-- -
5
- {}
5
+ {
6
+ " shape" : {
7
+ " type" : " Sketch" ,
8
+ " value" : {
9
+ " type" : " Sketch" ,
10
+ " id" : " [uuid]" ,
11
+ " paths" : [
12
+ {
13
+ " __geoMeta" : {
14
+ " id" : " [uuid]" ,
15
+ " sourceRange" : []
16
+ },
17
+ " from" : [
18
+ - 5.0 ,
19
+ - 5.0
20
+ ],
21
+ " tag" : null ,
22
+ " to" : [
23
+ 5.0 ,
24
+ - 5.0
25
+ ],
26
+ " type" : " ToPoint" ,
27
+ " units" : {
28
+ " type" : " Mm"
29
+ }
30
+ },
31
+ {
32
+ " __geoMeta" : {
33
+ " id" : " [uuid]" ,
34
+ " sourceRange" : []
35
+ },
36
+ " from" : [
37
+ 5.0 ,
38
+ - 5.0
39
+ ],
40
+ " tag" : null ,
41
+ " to" : [
42
+ 5.0 ,
43
+ 5.0
44
+ ],
45
+ " type" : " ToPoint" ,
46
+ " units" : {
47
+ " type" : " Mm"
48
+ }
49
+ },
50
+ {
51
+ " __geoMeta" : {
52
+ " id" : " [uuid]" ,
53
+ " sourceRange" : []
54
+ },
55
+ " from" : [
56
+ 5.0 ,
57
+ 5.0
58
+ ],
59
+ " tag" : null ,
60
+ " to" : [
61
+ - 5.0 ,
62
+ 5.0
63
+ ],
64
+ " type" : " ToPoint" ,
65
+ " units" : {
66
+ " type" : " Mm"
67
+ }
68
+ },
69
+ {
70
+ " __geoMeta" : {
71
+ " id" : " [uuid]" ,
72
+ " sourceRange" : []
73
+ },
74
+ " from" : [
75
+ - 5.0 ,
76
+ 5.0
77
+ ],
78
+ " tag" : null ,
79
+ " to" : [
80
+ - 5.0 ,
81
+ - 5.0
82
+ ],
83
+ " type" : " ToPoint" ,
84
+ " units" : {
85
+ " type" : " Mm"
86
+ }
87
+ }
88
+ ],
89
+ " on" : {
90
+ " artifactId" : " [uuid]" ,
91
+ " id" : " [uuid]" ,
92
+ " origin" : {
93
+ " x" : 0.0 ,
94
+ " y" : 0.0 ,
95
+ " z" : 0.0 ,
96
+ " units" : {
97
+ " type" : " Mm"
98
+ }
99
+ },
100
+ " type" : " plane" ,
101
+ " value" : " XY" ,
102
+ " xAxis" : {
103
+ " x" : 1.0 ,
104
+ " y" : 0.0 ,
105
+ " z" : 0.0 ,
106
+ " units" : {
107
+ " type" : " Unknown"
108
+ }
109
+ },
110
+ " yAxis" : {
111
+ " x" : 0.0 ,
112
+ " y" : 1.0 ,
113
+ " z" : 0.0 ,
114
+ " units" : {
115
+ " type" : " Unknown"
116
+ }
117
+ },
118
+ " zAxis" : {
119
+ " x" : 0.0 ,
120
+ " y" : 0.0 ,
121
+ " z" : 1.0 ,
122
+ " units" : {
123
+ " type" : " Unknown"
124
+ }
125
+ }
126
+ },
127
+ " start" : {
128
+ " from" : [
129
+ - 5.0 ,
130
+ - 5.0
131
+ ],
132
+ " to" : [
133
+ - 5.0 ,
134
+ - 5.0
135
+ ],
136
+ " units" : {
137
+ " type" : " Mm"
138
+ },
139
+ " tag" : null ,
140
+ " __geoMeta" : {
141
+ " id" : " [uuid]" ,
142
+ " sourceRange" : []
143
+ }
144
+ },
145
+ " artifactId" : " [uuid]" ,
146
+ " originalId" : " [uuid]" ,
147
+ " units" : {
148
+ " type" : " Mm"
149
+ }
150
+ }
151
+ }
152
+ }
You can’t perform that action at this time.
0 commit comments