Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19d4532

Browse files
dsymeKevinRansom
authored andcommitted
validate breakpoints in object constructor arguments (dotnet#4807)
* validate breakpoints in object constructor arguments* add tests
1 parent7ac2e7e commit19d4532

File tree

3 files changed

+302
-1
lines changed

3 files changed

+302
-1
lines changed

‎src/fsharp/range.fs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type pos(code:int32) =
4545
static memberDecode(code:int32):pos= pos code
4646
overridep.Equals(obj)=match objwith:? posas p2-> code= p2.Encoding|_->false
4747
overridep.GetHashCode()= hash code
48+
overridep.ToString()= sprintf"(%d,%d)" p.Line p.Column
4849

4950
[<Literal>]
5051
letfileIndexBitCount=14

‎src/fsharp/service/ServiceUntypedParse.fs‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,38 +228,49 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op
228228
| None->()
229229
yield! walkExprs(List.map(fun(_,v,_)-> v) fs|> List.choose id)
230230

231-
| SynExpr.ObjExpr(_,_,bs,is,_,_)->
231+
| SynExpr.ObjExpr(_,args,bs,is,_,_)->
232+
match argswith
233+
| None->()
234+
| Some(arg,_)->yield! walkExprfalse arg
232235
yield! walkBinds bs
233236
for(InterfaceImpl(_,bs,_))in isdoyield! walkBinds bs
237+
234238
| SynExpr.While(spWhile,e1,e2,_)->
235239
yield! walkWhileSeqPt spWhile
236240
yield! walkExprfalse e1
237241
yield! walkExprtrue e2
242+
238243
| SynExpr.JoinIn(e1,_range, e2,_range2)->
239244
yield! walkExprfalse e1
240245
yield! walkExprfalse e2
246+
241247
| SynExpr.For(spFor,_,e1,_,e2,e3,_)->
242248
yield! walkForSeqPt spFor
243249
yield! walkExprfalse e1
244250
yield! walkExprtrue e2
245251
yield! walkExprtrue e3
252+
246253
| SynExpr.ForEach(spFor,_,_,_,e1,e2,_)->
247254
yield! walkForSeqPt spFor
248255
yield! walkExprfalse e1
249256
yield! walkExprtrue e2
257+
250258
| SynExpr.MatchLambda(_isExnMatch,_argm,cl,spBind,_wholem)->
251259
yield! walkBindSeqPt spBind
252260
for(Clause(_,whenExpr,e,_,_))in cldo
253261
yield! walkExprOptfalse whenExpr
254262
yield! walkExprtrue e
263+
255264
| SynExpr.Lambda(_,_,_,e,_)->
256265
yield! walkExprtrue e
266+
257267
| SynExpr.Match(spBind,e,cl,_,_)->
258268
yield! walkBindSeqPt spBind
259269
yield! walkExprfalse e
260270
for(Clause(_,whenExpr,e,_,_))in cldo
261271
yield! walkExprOptfalse whenExpr
262272
yield! walkExprtrue e
273+
263274
| SynExpr.LetOrUse(_,_,bs,e,_)->
264275
yield! walkBinds bs
265276
yield! walkExprtrue e
@@ -275,21 +286,26 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op
275286
yield! walkExprtrue e2
276287
yield! walkTrySeqPt spTry
277288
yield! walkFinallySeqPt spFinally
289+
278290
| SynExpr.Sequential(spSeq,_,e1,e2,_)->
279291
yield! walkExpr(match spSeqwith SuppressSequencePointOnStmtOfSequential->false|_->true) e1
280292
yield! walkExpr(match spSeqwith SuppressSequencePointOnExprOfSequential->false|_->true) e2
293+
281294
| SynExpr.IfThenElse(e1,e2,e3opt,spBind,_,_,_)->
282295
yield! walkBindSeqPt spBind
283296
yield! walkExprfalse e1
284297
yield! walkExprtrue e2
285298
yield! walkExprOpttrue e3opt
299+
286300
| SynExpr.DotIndexedGet(e1,es,_,_)->
287301
yield! walkExprfalse e1
288302
yield! walkExprs[for ein esdoyield! e.Exprs]
303+
289304
| SynExpr.DotIndexedSet(e1,es,e2,_,_,_)->
290305
yield! walkExprfalse e1
291306
yield! walkExprs[for ein esdoyield! e.Exprs]
292307
yield! walkExprfalse e2
308+
293309
| SynExpr.DotNamedIndexedPropertySet(e1,_,e2,e3,_)->
294310
yield! walkExprfalse e1
295311
yield! walkExprfalse e2
@@ -321,6 +337,10 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op
321337
| SynMemberDefn.Inherit(_,_, m)->
322338
// can break on the "inherit" clause
323339
yield! checkRange m
340+
| SynMemberDefn.ImplicitInherit(_, arg,_, m)->
341+
// can break on the "inherit" clause
342+
yield! checkRange m
343+
yield! walkExprtrue arg
324344
|_->()]
325345

326346
// Process declarations nested in a module that should be displayed in the left dropdown

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp