Skip to content

Commit 906b8a2

Browse files
committed
fixed ReturnCheck handling of enforceReturnType
1 parent 4513448 commit 906b8a2

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

checkstyle/checks/ReturnCheck.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class ReturnCheck extends Check {
3434
case FFun(fun):
3535
if (fun.ret == null) {
3636
_warnReturnTypeMissing(f.name, f.pos);
37+
return;
3738
}
39+
return;
3840
default:
3941
}
4042
}

run.n

8 Bytes
Binary file not shown.

test/ReturnCheckTest.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ReturnCheckTest extends CheckTestCase {
3535
assertEquals(msg, '');
3636

3737
msg = checkMessage(ReturnTests.TEST2, check);
38-
assertEquals(msg, 'Return type not specified when returning a value for function: test1');
38+
assertEquals(msg, 'Return type not specified for function: test1');
3939

4040
msg = checkMessage(ReturnTests.TEST3, check);
4141
assertEquals(msg, 'Return type not specified for function: test2');

0 commit comments

Comments
 (0)