Skip to content

Commit

Permalink
Merge branch 'fix/issue279'
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Oct 13, 2013
2 parents 56dae7e + 414f047 commit 5374130
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/classdef.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ class ClassDefinition implements Stashable {
}
if (! Util.typesAreEqual((this._members[i] as MemberFunctionDefinition).getArgumentTypes(), member.getArgumentTypes()))
continue;
if ((! isCheckingInterface) && (member.flags() & ClassDefinition.IS_OVERRIDE) == 0) {
if ((! isCheckingInterface) && ((member.flags() | this._members[i].flags()) & ClassDefinition.IS_STATIC) == 0 && (member.flags() & ClassDefinition.IS_OVERRIDE) == 0) {
var error = new CompileError(member.getNameToken(), "overriding functions must have 'override' attribute set");
error.addCompileNote(new CompileNote(this._members[i].getNameToken(), Util.format("defined in base class '%1'", [this.classFullName()])));
context.errors.push(error);
Expand Down
21 changes: 21 additions & 0 deletions t/run/357.issue279-static-method.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*EXPECTED
ok
*/

class StaticParent
{
static function f() : void { }
}

class StaticInstanceChild extends StaticParent
{
function f() : void { }
}

class _Main {
static function main(args : string[]):void {
log "ok";
}
}

// vim: set expandtab tabstop=2 shiftwidth=2 ft=jsx:

0 comments on commit 5374130

Please sign in to comment.