Skip to content

Commit 677f64b

Browse files
committed
cleanup
1 parent b07e11f commit 677f64b

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

checkstyle/checks/VariableInitialisationCheck.hx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,17 @@ class VariableInitialisationCheck extends Check {
5858
}
5959

6060
function _genericCheck(isInline:Bool, isPrivate:Bool, isPublic:Bool, isStatic:Bool, f:Field) {
61-
//trace(Std.string(f.kind));
6261
if (isPrivate || isPublic) {
63-
if (Std.string(f.kind).indexOf("FVar") > -1 && Std.string(f.kind).indexOf("expr =>") > -1) {
64-
_warnVarinit(f.name, f.pos);
65-
return;
62+
switch (f.kind) {
63+
case FVar(t, a):
64+
if (Std.string(f.kind).indexOf("expr =>") > -1) {
65+
_warnVarinit(f.name, f.pos);
66+
return;
67+
}
68+
case FFun(f):
69+
return;
70+
case FProp(g, s, t, a):
71+
return;
6672
}
6773
}
6874
}

run.n

276 Bytes
Binary file not shown.

test/AnonymousCheckTest.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
package ;
22

3-
class AnonymousCheckTest {
3+
class AnonymousCheckTest{
44

55
var _anonymous:{a:Int, b:Int};
66

7+
public var chips:Array<{chipIndex:Int, position:String}>;
8+
9+
public function test1(_chips:Array<{chipIndex:Int, position:String}>) {
10+
chips = _chips;
11+
}
12+
713
public function new() {
814
var b:{a:Int, b:Int};
915
_anonymous = {a: 2, b: 5};

0 commit comments

Comments
 (0)