anchor.diff:  let t as (u) = 12
   let v as struct(w, x) = 13, 14
   let y as z : int = 15{set { 'a'..'x' } - set [ 'p'; 'v' ] |> Set.map (sprintf " + %c") |> System.String.Concat}
  -let _ : AAA = p
  -let _ : struct(int * int) = v
  +Some p |> eq<AAA>
  +Some v |> eq<struct(int * int)>
   ()
   """
       assertHasSymbolUsages (List.map string ['a'..'z']) checkResults
  
positive.code: #endif
  let ``As 08 - syntactical precedence matrix testing right - partial patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None
  let (|Unit2|_|) _ = (|Unit1|_|)
  let (|Id1|_|) x = if System.Random().NextDouble() < 0.5 then Some x else None
  let (|Id2|_|) _ = (|Id1|_|)
  let a = 1
  let b as c::d as e = 2::3
  let f as Unit1 = 4
  let g as Unit2 a h = 5
  let i as Id1 j = 4
  let k as Id2 a l = 5
  box 6 |> function
  | m as :? int ->
  box {| aaa = 7 |} |> function
  | n as :? {| aaa : int |} ->
  let o as [p] = [8]
  let q as [|r|] = [|9|]
  let s as 10 = 10
  let t as false = false
  let u as true = true
  let v as null = null
  let w as (null) = null
  let x as y : int = 15 + a + b + c + f + g + i + j + k + l + m + p + r + s
  let _ : int list = d
  let _ : int list = e
  let _ as () = h
  let _ : {| aaa : int |} = n
  let _ : int list = o
  let _ : int[] = q
  let _ : bool = t
  let _ : bool = u
  let _ : obj = v
  let _ : obj = w
  ()
  """
      assertHasSymbolUsages (List.map string ['a'..'y']) checkResults
      dumpErrors checkResults |> shouldEqual [
          "(7,24--7,25): This expression was expected to have type 'int list' but here has type 'int'"
          "(7,4--7,18): Incomplete pattern matches on this expression. For example, the value '[]' may indicate a case not covered by the pattern(s)."
          "(8,4--8,14): Incomplete pattern matches on this expression."
          "(9,4--9,18): Incomplete pattern matches on this expression."
          "(10,4--10,14): Incomplete pattern matches on this expression."
          "(11,4--11,16): Incomplete pattern matches on this expression."
          "(22,4--22,15): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(21,4--21,13): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(20,4--20,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."
          "(19,4--19,14): Incomplete pattern matches on this expression. For example, the value 'true' may indicate a case not covered by the pattern(s)."
          "(18,4--18,11): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."
          "(17,4--17,14): Incomplete pattern matches on this expression. For example, the value '[|_; _|]' may indicate a case not covered by the pattern(s)."
          "(16,4--16,12): Incomplete pattern matches on this expression. For example, the value '[_;_]' may indicate a case not covered by the pattern(s)."
          "(14,21--14,29): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(12,9--12,17): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
      ]
  
  [<Test>]
  
negative.code:     ]
  
  [<Test>]
  let ``As 13 - syntactical precedence matrix testing right with type tests - total patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview $"""
  let eq<'T> (x:'T option) = () // FS-1093-safe type assert function
  let (|Id0|) = ignore
  let (|Id1|) = id
  let (|Id2|) _ = id
  type AAA = {{ aaa : int }}
  let a = 1
  match box 2 with
  | :? int as b as c ->
  match box 3 with
  | :? int as d | :? int & d as e -> // The left d has type 'int', the right d has type 'obj'
  match box 4, 5 with
  | :? int as f, g & h ->
  match box 6 with
  | :? int as i & j as k ->
  match box 7 with
  | :? int as Id1 l as m ->
  match box 8 with
  | :? int as Id2 a n as o ->
  match box {{ aaa = 9 }} with
  | :? AAA as {{ aaa = p }} as q ->
  match box 10 with
  | :? int as _ as r ->
  match box 11 with
  | :? int as Id0 as s ->
  match box 12 with
  | :? int as (t) as u ->
  match box struct(13, 14) with
  | :? struct(int * int) as struct(v, w) as x ->
  let y as z : int = 15 + a + b + d + f + g + h + i + l + n + p + t + v + w
  Some c |> eq<obj>
  Some e |> eq<obj>
  Some j |> eq<obj>
  Some k |> eq<obj>
  Some m |> eq<obj>
  Some o |> eq<obj>
  Some q |> eq<obj>
  Some r |> eq<obj>
  Some s |> eq<obj>
  Some u |> eq<obj>
  Some x |> eq<obj>
  ()
  """
      assertHasSymbolUsages (List.map string ['a'..'z']) checkResults
      dumpErrors checkResults |> shouldEqual [
          "(11,25--11,26): This expression was expected to have type 'int' but here has type 'obj'"
          "(28,6--28,24): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(26,6--26,12): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(20,6--20,21): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(16,6--16,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(14,6--14,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(12,6--12,14): Incomplete pattern matches on this expression. For example, the value '(( some-other-subtype ),_)' may indicate a case not covered by the pattern(s)."
          "(10,6--10,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(8,6--8,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
      ]
      
  [<Test>]
  #if !NETCOREAPP
  [<Ignore("These tests weren't running on desktop and this test fails")>]
  #endif
  let ``As 14 - syntactical precedence matrix testing right with type tests - partial patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  let eq<'T> (x:'T option) = () // FS-1093-safe type assert function
  let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None
  let (|Unit2|_|) _ = (|Unit1|_|)
  let (|Id1|_|) x = if System.Random().NextDouble() < 0.5 then Some x else None
  let (|Id2|_|) _ = (|Id1|_|)
  let a = 1
  match box 2::[box 3] with
  | :? int as b as c::d as e ->
  match box 4 with
  | :? int as Unit1 as f ->
  match box 5 with
  | :? int as Unit2 a g as h ->
  match box 6 with
  | :? int as Id1 i as j ->
  match box 7 with
  | :? int as Id2 a k as l ->
  match box 8 with
  | :? System.ValueType as :? int as m ->
  match box {| aaa = 9 |} with
  | :? obj as :? {| aaa : int |} as n ->
  match box [10] with
  | :? (int list) as [o] as p ->
  match box [|11|] with
  | :? (int[]) as [|q|] as r ->
  match box 12 with
  | :? int as 12 as s ->
  match box false with
  | :? bool as false as t ->
  match box true with
  | :? bool as true as u ->
  match box null with
  | :? System.ValueType as null as v ->
  match box null with
  | :? System.ValueType as (null) as w ->
  let x as y : int = 13 + a + b + i + k + o + q
  Some c |> eq<obj>
  Some d |> eq<obj list>
  Some e |> eq<obj list>
  Some f |> eq<obj>
  Some g |> eq<unit>
  Some h |> eq<obj>
  Some j |> eq<obj>
  Some l |> eq<obj>
  Some m |> eq<obj>
  Some n |> eq<obj>
  Some p |> eq<obj>
  Some r |> eq<obj>
  Some s |> eq<obj>
  Some t |> eq<obj>
  Some u |> eq<obj>
  Some v |> eq<obj>
  Some w |> eq<obj>
  ()
  """
      assertHasSymbolUsages (set ['a' .. 'y'] |> Set.remove 'n' |> Set.map string |> Set.toList) checkResults
      dumpErrors checkResults |> shouldEqual [
          "(21,2--21,8): This type test or downcast will always hold"
          "(34,6--34,14): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(32,6--32,14): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(30,6--30,14): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."
          "(28,6--28,15): Incomplete pattern matches on this expression. For example, the value 'true' may indicate a case not covered by the pattern(s)."
          "(26,6--26,12): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."
          "(24,6--24,16): Incomplete pattern matches on this expression. For example, the value '[|_; _|]' may indicate a case not covered by the pattern(s)."
          "(22,6--22,14): Incomplete pattern matches on this expression. For example, the value '[_;_]' may indicate a case not covered by the pattern(s)."
          "(20,6--20,23): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(16,6--16,11): Incomplete pattern matches on this expression."
          "(14,6--14,11): Incomplete pattern matches on this expression."
          "(12,6--12,11): Incomplete pattern matches on this expression."
          "(10,6--10,11): Incomplete pattern matches on this expression."
          "(8,6--8,20): Incomplete pattern matches on this expression. For example, the value '[( some-other-subtype )]' may indicate a case not covered by the pattern(s)."
      ]
  
  [<Test>]
  #if !NETCOREAPP
  [<Ignore("These tests weren't running on desktop and this test fails")>]
  #endif
  let ``As 15 - syntactical precedence matrix testing right with type tests - erroneous patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  let (|DefinedPattern|) = id
  let :? a as 1 = true
  let :? b as true = 2
  let :? c as :? int = box 3
  let :? d as :? int = 4
  let :? e as UndefinedPattern = 5
  let :? f as DefinedPattern () = 6
  let :? g as DefinedPattern = 7
  let :? h as , i = 8
  let :? j as : k = 9
  let :? l as :: m = 10
  let :? n as & o = 11
  let :? p as | q = 12
  let :? r as ( s = 13
  let :? t as ) u = 14
  let :? v as struct w = 15
  let :? x as () = y
  let :? z as
  """
      dumpErrors checkResults |> shouldEqual [
          "(10,12--10,13): Unexpected symbol ',' in binding"
          "(11,12--11,13): Unexpected symbol ':' in binding"
          "(12,12--12,14): Unexpected symbol '::' in binding"
          "(13,12--13,13): Unexpected symbol '&' in binding"
          "(14,12--14,13): Unexpected symbol '|' in binding"
          "(15,16--15,17): Unexpected symbol '=' in pattern. Expected ')' or other token."
          "(15,12--15,13): Unmatched '('"
          "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:13). Try indenting this token further or using standard formatting conventions."
          "(17,19--17,20): Unexpected identifier in pattern. Expected '(' or other token."
          "(20,0--20,0): Incomplete structured construct at or before this point in binding"
          "(3,7--3,8): The type 'a' is not defined."
          "(3,4--3,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(4,7--4,8): The type 'b' is not defined."
          "(4,4--4,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(5,7--5,8): The type 'c' is not defined."
          "(5,4--5,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(6,7--6,8): The type 'd' is not defined."
          "(6,4--6,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(7,7--7,8): The type 'e' is not defined."
          "(7,4--7,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(8,7--8,8): The type 'f' is not defined."
          "(8,4--8,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(9,7--9,8): The type 'g' is not defined."
          "(9,4--9,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(15,7--15,8): The type 'r' is not defined."
          "(15,4--15,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(18,7--18,8): The type 'x' is not defined."
          "(18,4--18,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
      ]
  
  [<Test>]
  let ``As 16 - syntactical precedence matrix testing left with type tests - total patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview $"""
  let (|Id0|) = ignore
  let (|Id1|) = id
  let (|Id2|) _ = id
  type AAA = {{ aaa : int }}
  let a = 1
  let b as c = 2
  let d | d as e = 3
  let f, g as h = 4, 5
  let i & j as k = 6
  let Id1 l as m = 7
  let Id2 a n as o = 8
  let {{ aaa = p }} as q = {{ aaa = 9 }}
  let _ as r = 10
  let Id0 as s = 11
  let (t) as u = 12
  let struct(w, v) as x = 13, 14
  let (y : int) as z = 15{set { 'a'..'v' } - set [ 'h'; 'q' ] |> Set.map (sprintf " + %c") |> System.String.Concat}
  let _ : int * int = h
  let _ : AAA = q
  let _ : struct(int * int) = x
  ()
  """
      assertHasSymbolUsages (List.map string ['a'..'z']) checkResults
      dumpErrors checkResults |> shouldEqual []
      
  [<Test>]
  #if !NETCOREAPP
  [<Ignore("These tests weren't running on desktop and this test fails")>]
  #endif
  let ``As 17 - syntactical precedence matrix testing left with type tests - partial patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  let (|Unit1|_|) x = if System.Random().NextDouble() < 0.5 then Some Unit1 else None
  let (|Unit2|_|) _ = (|Unit1|_|)
  let (|Id1|_|) x = if System.Random().NextDouble() < 0.5 then Some x else None
  let (|Id2|_|) _ = (|Id1|_|)
  let a = 1
  let b as (c::d as e) = 2::3
  let Unit1 as f = 4
  let Unit2 a g as h = 5
  let Id1 i as j = 6
  let Id2 a k as l = 7
  box 8 |> function
  | :? int as m ->
  box {| aaa = 9 |} |> function
  | :? {| aaa : int |} as n ->
  let [o] as p = [10]
  let [|q|] as r = [|11|]
  let 10 as s = 12
  let false as t = false
  let true as u = true
  let null as v = null
  let (null) as w = null
  let (x : int) as y = 13 + a + c + f + g + i + j + k + l + m + p + r + s
  let _ : int list = b
  let _ : int list = d
  let _ : int list = e
  let () as _ = h
  let _ : {| aaa : int |} = n
  let _ : int list = o
  let _ : int[] = q
  let _ : bool = t
  let _ : bool = u
  let _ : obj = v
  let _ : obj = w
  ()
  """
      assertHasSymbolUsages (List.map string ['a'..'y']) checkResults
      dumpErrors checkResults |> shouldEqual [
          "(7,26--7,27): This expression was expected to have type 'int list' but here has type 'int'"
          "(7,4--7,20): Incomplete pattern matches on this expression. For example, the value '[]' may indicate a case not covered by the pattern(s)."
          "(8,4--8,14): Incomplete pattern matches on this expression."
          "(9,4--9,18): Incomplete pattern matches on this expression."
          "(10,4--10,14): Incomplete pattern matches on this expression."
          "(11,4--11,16): Incomplete pattern matches on this expression."
          "(23,38--23,39): The type 'unit' does not match the type 'int'"
          "(27,14--27,15): This expression was expected to have type 'unit' but here has type 'int'"
          "(29,19--29,20): This expression was expected to have type 'int list' but here has type 'int'"
          "(30,16--30,17): This expression was expected to have type 'int []' but here has type 'int'"
          "(22,4--22,15): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(21,4--21,13): Incomplete pattern matches on this expression. For example, the value '( some-non-null-value )' may indicate a case not covered by the pattern(s)."
          "(20,4--20,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."
          "(19,4--19,14): Incomplete pattern matches on this expression. For example, the value 'true' may indicate a case not covered by the pattern(s)."
          "(18,4--18,11): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."
          "(17,4--17,14): Incomplete pattern matches on this expression. For example, the value '[|_; _|]' may indicate a case not covered by the pattern(s)."
          "(16,4--16,12): Incomplete pattern matches on this expression. For example, the value '[_;_]' may indicate a case not covered by the pattern(s)."
          "(14,21--14,29): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
          "(12,9--12,17): Incomplete pattern matches on this expression. For example, the value '( some-other-subtype )' may indicate a case not covered by the pattern(s)."
      ]
  
  [<Test>]
  #if !NETCOREAPP
  [<Ignore("These tests weren't running on desktop and this test fails")>]
  #endif
  let ``As 18 - syntactical precedence matrix testing left with type tests - erroneous patterns`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  let (|DefinedPattern|) = id
  let 1 as a = true
  let true as b = 2
  let :? int as c = box 3
  let :? int as d = 4
  let UndefinedPattern as e = 5
  let DefinedPattern () as f = 6
  let DefinedPattern as g = 7
  let h, as i = 8
  let j : _ as k = 9
  let l :: as m = 10
  let n & as o = 11
  let p | as q = 12
  let r ( as s = 13
  let t ) as u = 14
  let v struct as w = 15
  let () as x = y
  let z as =
  """
      dumpErrors checkResults |> shouldEqual [
          "(10,7--10,9): Unexpected keyword 'as' in binding"
          "(11,10--11,12): Unexpected keyword 'as' in binding. Expected '=' or other token."
          "(12,9--12,11): Unexpected keyword 'as' in binding"
          "(13,8--13,10): Unexpected keyword 'as' in binding"
          "(14,8--14,10): Unexpected keyword 'as' in binding"
          "(15,8--15,10): Unexpected keyword 'as' in pattern. Expected ')' or other token."
          "(15,6--15,7): Unmatched '('"
          "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:7). Try indenting this token further or using standard formatting conventions."
          "(16,0--16,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token."
          "(15,0--15,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword."
          "(17,0--17,3): Incomplete structured construct at or before this point in implementation file"
          "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."
          "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."
          "(3,13--3,17): This expression was expected to have type 'int' but here has type 'bool'"
          "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."
          "(4,16--4,17): This expression was expected to have type 'bool' but here has type 'int'"
          "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."
          "(5,4--5,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(6,4--6,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."
          "(8,29--8,30): This expression was expected to have type 'unit' but here has type 'int'"
          "(9,26--9,27): This expression was expected to have type 'unit' but here has type 'int'"
          "(15,4--15,5): The pattern discriminator 'r' is not defined."
          "(15,4--15,12): Incomplete pattern matches on this expression."
      ]
  
  [<Test>]
  #if !NETCOREAPP
  [<Ignore("These tests weren't running on desktop and this test fails")>]
  #endif
  let ``As 19 - syntactical precedence matrix testing - valid syntactic patterns that cause type errors later`` () =
      let _, checkResults = getParseAndCheckResultsPreview """
  type I() = inherit System.Attribute()
  type M() = inherit I()
  