Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Number:

GEP-11

Title:

Groovy 3 semantics and new MOP

Version:

1.8.12

Type:

Feature

Target:

3.0

Status:

Draft

Leader:

Jochen "blackdrag" Theodorou

Created:

2012-06-26

Last modification:

2013-0410-0211

Last update by:
Contributors
limit1

...

  • make indy the only compilation target in the build
  • move all non-indy bytecode interfacing code to a module, which may be removed later. This includes ScriptBytecodeAdpater as well as all the custom call site caching classes
  • make a new module for MOP2
  • turn meta class into an immutable
  • implement meta class views

Module Extension Methods Shadowing Rules

Module Extensions Methods are in the old and new MOP defined by the DefaultGroovyMethods related classes and module extension, like groovy-swing. In the definition here we will use the terms of from "inside" and from "outside" to define a callsite, that lies in the same class as the target method (inside) or not (outside). The general rules are:

  • public methods are shadowed
  • private methods are shadowed for outside callsites, but not for inside callsites

Subclasses of the class the module extension method has been applied to have these extended rules:

  • if the subclass defines a private method of the same signature as the module extension method, then outside callsites will still see the extension method, inside callsites the private method
  • A call to "super" or "this" will call the module extension method. As such the subclass is seen as outside callsite.

Open Blocks are not seen as separate classes.

Breaking changes trace

groovy.lang.MetaObjectProtocol (currently in groovy.mop.MetaObjectProtocol):

...