Hi Alex,

I'm not sure what lately has changed in the compiler, but in MDL and Mobile
there are a lot of weard errors. Maven build passes, but it shouldn't.

Any thoughts on that?

Thanks,
Piotr

W dniu czwartek, 9 marca 2017 <aha...@apache.org> napisaƂ(a):

> Repository: flex-falcon
> Updated Branches:
>   refs/heads/develop 6e14d6835 -> dad773a21
>
>
> fix interface override checking
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/dad773a2
> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/dad773a2
> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/dad773a2
>
> Branch: refs/heads/develop
> Commit: dad773a2193b5a80aee1e5a5f82d30b82ac19431
> Parents: 6e14d68
> Author: Alex Harui <aha...@apache.org <javascript:;>>
> Authored: Wed Mar 8 22:42:14 2017 -0800
> Committer: Alex Harui <aha...@apache.org <javascript:;>>
> Committed: Wed Mar 8 22:42:14 2017 -0800
>
> ----------------------------------------------------------------------
>  .../semantics/MethodBodySemanticChecker.java    |  7 +++
>  .../src/test/java/as/ASInheritanceTests.java    | 59 ++++++++++++++++++++
>  2 files changed, 66 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/
> dad773a2/compiler/src/main/java/org/apache/flex/compiler/
> internal/semantics/MethodBodySemanticChecker.java
> ----------------------------------------------------------------------
> diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/
> semantics/MethodBodySemanticChecker.java b/compiler/src/main/java/org/
> apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
> index 1b51727..3904823 100644
> --- a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/
> MethodBodySemanticChecker.java
> +++ b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/
> MethodBodySemanticChecker.java
> @@ -2799,7 +2799,14 @@ public class MethodBodySemanticChecker
>          if( conflicts.size() > 0 )
>          {
>              for( IFunctionDefinition overriden : conflicts )
> +            {
> +               if ((overriden instanceof SetterDefinition &&
> +                       funcDef instanceof GetterDefinition) ||
> +                       (overriden instanceof GetterDefinition &&
> +                       funcDef instanceof SetterDefinition))
> +                       continue;
>                  addProblem(new InterfaceMethodOverrideProblem(iNode,
> funcDef.getBaseName(), overriden.getParent().getBaseName()));
> +            }
>          }
>
>      }
>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/
> dad773a2/compiler/src/test/java/as/ASInheritanceTests.java
> ----------------------------------------------------------------------
> diff --git a/compiler/src/test/java/as/ASInheritanceTests.java
> b/compiler/src/test/java/as/ASInheritanceTests.java
> index 4d1d393..b5833e1 100644
> --- a/compiler/src/test/java/as/ASInheritanceTests.java
> +++ b/compiler/src/test/java/as/ASInheritanceTests.java
> @@ -83,4 +83,63 @@ public class ASInheritanceTests  extends
> ASFeatureTestsBase{
>
>          compileAndExpectErrors(source, false,false,false, null,"No
> default constructor found in base class A.\n");
>      }
> +
> +    @Test
> +    public void InterfaceOverrideError()
> +    {
> +        // all tests can assume that flash.display.Sprite
> +        // flash.system.System and flash.events.Event have been imported
> +        String[] imports = new String[]
> +                {
> +                };
> +        String[] declarations = new String[]
> +                {
> +                };
> +        String[] testCode = new String[]
> +                {
> +
> +                };
> +        String[] extra = new String[]
> +                {
> +                        "interface A {",
> +                        "function get text():String;",
> +                        "}",
> +                        "interface B extends A {",
> +                        "function get text():String;",
> +                        "}"
> +                };
> +        String source = getAS(imports, declarations, testCode, extra);
> +
> +        compileAndExpectErrors(source, false,false,false, null,"Cannot
> override an interface method.  Method text conflicts with a method in base
> interface A.\n");
> +    }
> +
> +    @Test
> +    public void InterfaceOverrideOK()
> +    {
> +        // all tests can assume that flash.display.Sprite
> +        // flash.system.System and flash.events.Event have been imported
> +        String[] imports = new String[]
> +                {
> +                };
> +        String[] declarations = new String[]
> +                {
> +                };
> +        String[] testCode = new String[]
> +                {
> +
> +                };
> +        String[] extra = new String[]
> +                {
> +                        "interface A {",
> +                        "function get text():String;",
> +                        "}",
> +                        "interface B extends A {",
> +                        "function set text(value:String):void;",
> +                        "}"
> +                };
> +        String source = getAS(imports, declarations, testCode, extra);
> +
> +        compileAndRun(source);;
> +    }
> +
>  }
>
>

-- 

Greetings
Piotr Zarzycki

Flex/AIR/.NET Developer

mobile: +48 880 859 557
e-mail: piotrzarzyck...@gmail.com
skype: zarzycki10

LinkedIn: http://www.linkedin.com/piotrzarzycki
<https://pl.linkedin.com/in/piotr-zarzycki-92a53552>

Reply via email to