Skip to content

Commit

Permalink
Merge pull request #31 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
prepare 0.30.0
  • Loading branch information
aliokan authored Oct 4, 2017
2 parents e808219 + fe22349 commit 89bae50
Show file tree
Hide file tree
Showing 14 changed files with 451 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ install:
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexInject.git ./hexinject
- haxelib dev hexinject ./hexinject
#tink_macro
- haxelib install tink_macro 0.14.1
- haxelib install tink_macro 0.15.0
#hexDSL
- haxelib dev hexdsl .
- export DISPLAY=:99.0;
Expand Down
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"dependencies":
{
"hexinject": "git:https://github.com/DoclerLabs/hexInject.git",
"tink_macro": "0.14.1"
"tink_macro": "0.15.0"
}
}
18 changes: 10 additions & 8 deletions src/hex/compiletime/basic/CompileTimeContextFactory.hx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class CompileTimeContextFactory
return null;
}

function _getMappingDefinitions( e : Expr )
function _getMappingDefinitions( e : Expr ) : Array<hex.di.mapping.MappingDefinition>
{
var a = [];
switch( e.expr )
Expand Down Expand Up @@ -358,21 +358,23 @@ class CompileTimeContextFactory
case _:
}

return a;
return cast a;
}

function _checkDependencies( constructorVO : ConstructorVO ) : Void
{
if ( MacroUtil.implementsInterface( this._getClassType( constructorVO.className ), _dependencyInterface ) )
{
var mappings = constructorVO.arguments.filter(
function ( arg ) return arg.ref != null )
.map( function ( arg ) return this._coreFactory.locate( arg.ref ) )
.flatMap( _getMappingDefinitions );
var mappings = constructorVO.arguments
.filter( function ( arg ) return arg.ref != null )
.map( function ( arg ) return this._coreFactory.locate( arg.ref ) )
.filter( function ( arg ) return arg != null )
.flatMap( _getMappingDefinitions )
.array();

if ( !hex.di.mapping.MappingChecker.matchForClassName( constructorVO.className, cast mappings ) )
if ( !hex.di.mapping.MappingChecker.matchForClassName( constructorVO.className, mappings ) )
{
var missingMappings = hex.di.mapping.MappingChecker.getMissingMapping( constructorVO.className, cast mappings );
var missingMappings = hex.di.mapping.MappingChecker.getMissingMapping( constructorVO.className, mappings );
Context.fatalError( "Missing mappings:" + missingMappings, constructorVO.filePosition );
}
}
Expand Down
Loading

0 comments on commit 89bae50

Please sign in to comment.