Skip to content

Commit 5c931fa

Browse files
committed
C#: Improve comments.
1 parent d5ee93d commit 5c931fa

File tree

2 files changed

+4
-4
lines changed
  • csharp
    • extractor/Semmle.Extraction.CSharp/Entities/Types
    • ql/test/library-tests/standalone/brokentypes

2 files changed

+4
-4
lines changed

csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/Type.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static bool ConstructedOrParentIsConstructed(INamedTypeSymbol symbol)
2626
}
2727

2828
/// <summary>
29-
/// Returns true in case we suspect this is broken type.
29+
/// Returns true in case we suspect this is a broken type.
3030
/// </summary>
3131
/// <param name="symbol">Type symbol</param>
3232
private bool IsBrokenType(ITypeSymbol symbol)
@@ -38,8 +38,8 @@ private bool IsBrokenType(ITypeSymbol symbol)
3838
return false;
3939
}
4040

41-
// (1) public class { ... } is a broken type and doesn't have a name.
42-
// (2) public class var { ... } is a an allowed type, but it overrides the var keyword for all uses.
41+
// (1) public class { ... } is a broken type as it doesn't have a name.
42+
// (2) public class var { ... } is an allowed type, but it overrides the `var` keyword for all uses.
4343
// It is probably a better heuristic to treat it as a broken type.
4444
return string.IsNullOrEmpty(symbol.Name) || symbol.Name == "var";
4545
}

csharp/ql/test/library-tests/standalone/brokentypes/BrokenTypes.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void Main()
1818
string y1 = x1.Prop;
1919

2020
var x2 = new C(); // Has type `var` as this overrides the implicitly typed keyword `var`.
21-
var y2 = x2.Prop; // Unknown type as `x2` har type `var`.
21+
var y2 = x2.Prop; // Unknown type as `x2` has type `var`.
2222

2323
C2 x3 = new C2(); // Unknown type.
2424
var y3 = x3.Prop; // Unknown property of unknown type.

0 commit comments

Comments
 (0)