Skip to content

Commit

Permalink
Remove implicit this in abstract methods, not the last argument
Browse files Browse the repository at this point in the history
closes #266
  • Loading branch information
Gama11 committed Mar 27, 2020
1 parent 324859f commit 39f68d1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### 1.3.1 (to be released)

- changed the order in which fields are shown (first static, then instance fields)
- fixed last argument of abstract methods being removed instead of implicit `this` ([#266](https://github.com/HaxeFoundation/dox/pull/266))

### 1.3.0 (March 11, 2020)

Expand Down
Binary file modified run.n
Binary file not shown.
2 changes: 1 addition & 1 deletion src/dox/Processor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Processor {
else
switch (cf.type) {
case CFunction(args, _):
args.pop();
args.shift();
case _:
}
fields.push(cf);
Expand Down
11 changes: 10 additions & 1 deletion test/TestClass.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* var foo = bar;
* ```
*/

class TestClass {
static function main() {}

Expand Down Expand Up @@ -147,6 +146,7 @@ typedef TestTypedef = {
And a Second Line `"type":"ItemDetail"`
**/
var myField:String;

@:dox(hide) var hiddenField:Bool;
}

Expand Down Expand Up @@ -186,6 +186,13 @@ abstract TestEnumAbstract(Int) {
var value = 0;
}

abstract TestAbstract(Int) {
/**
Method should have `a:Int` and `b:String` arguments, but the implicit `this` argument shouldn't show up.
**/
public function foo(a:Int, b:String) {}
}

/**
Properties should be sorted alphabetically.
**/
Expand Down Expand Up @@ -265,6 +272,7 @@ class TestMetaData {
@:deprecated("Use `red` instead")
@:metaWithoutParams
public static var deprecatedRed = 0xFF0000;

@:meta
@:to
public static var red = 12;
Expand All @@ -275,6 +283,7 @@ class TestMetaData {
This should not be visible on the index page.
**/
class Index {}

@:generic class GenericClass<T> {}
class ChildOfGeneric extends GenericClass<String> {}

Expand Down

0 comments on commit 39f68d1

Please sign in to comment.