Projects >> ceylon-compiler >>8b4ffe4203c537eb1c9962b6d78f0043e846d032

Chunk
Conflicting content
                }
            }
        }
<<<<<<< HEAD
        if (Context.isCeylon() && sym.kind >= AMBIGUOUS) {
            // Look for toplevel extension classes
            List candidates = List.nil();
            CeylonTree.CompilationUnit cu = Context.ceylonCompilationUnit();
            for (CeylonTree.ImportDeclaration id : cu.importDeclarations) {
                for (CeylonTree.ImportPath path : id.path()) {
                    List elements = path.pathElements;
                    if (elements.get(elements.size() - 1).equals("*"))
                        continue;
                    // TODO: check for "import implicit"
                    StringBuilder sb = new StringBuilder();
                    for (String element : elements) {
                        if (sb.length() > 0)
                            sb.append('.');
                        sb.append(element);
                    }
                    ClassSymbol candidate = reader.enterClass(names.fromString(sb.toString()));
                    if (candidate.attribute(syms.ceylonExtensionType.tsym) == null)
                        continue;
                    Symbol resolved = resolveQualifiedMethod(
                        env, candidate.type, name, argtypes, typeargtypes);
                    if (resolved.kind != MTH)
                        continue;
                    Route extension = types.getCeylonExtension(site, candidate.type);
                    if (extension == null)
                        continue;
                    candidates = candidates.append(extension);
                }
            }
            assert candidates.size() == 0; // XXX < 2
        }
=======
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b
        if (sym.kind >= AMBIGUOUS) {
            sym = access(sym, pos, site, name, true, argtypes, typeargtypes);
        }
Solution content
                }
            }
        }
        if (Context.isCeylon() && sym.kind >= AMBIGUOUS) {
            // Look for toplevel extension classes
            List candidates = List.nil();
            CeylonTree.CompilationUnit cu = Context.ceylonCompilationUnit();
            for (CeylonTree.ImportDeclaration id : cu.importDeclarations) {
                for (CeylonTree.ImportPath path : id.path()) {
                    List elements = path.pathElements;
                    if (elements.get(elements.size() - 1).equals("*"))
                        continue;
                    // TODO: check for "import implicit"
                    StringBuilder sb = new StringBuilder();
                    for (String element : elements) {
                        if (sb.length() > 0)
                            sb.append('.');
                        sb.append(element);
                    }
                    ClassSymbol candidate = reader.enterClass(names.fromString(sb.toString()));
                    if (candidate.attribute(syms.ceylonExtensionType.tsym) == null)
                        continue;
                    Symbol resolved = resolveQualifiedMethod(
                        env, candidate.type, name, argtypes, typeargtypes);
                    if (resolved.kind != MTH)
                        continue;
                    Route extension = types.getCeylonExtension(site, candidate.type);
                    if (extension == null)
                        continue;
                    candidates = candidates.append(extension);
                }
            }
            assert candidates.size() == 0; // XXX < 2
        }
        if (sym.kind >= AMBIGUOUS) {
            sym = access(sym, pos, site, name, true, argtypes, typeargtypes);
        }
File
Resolve.java
Developer's decision
Version 1
Kind of conflict
If statement
Chunk
Conflicting content
        //      System.err.println("completing " + c);//DEBUG

        try {
<<<<<<< HEAD
            context.enterJava();
=======
            Context.SourceLanguage.push(Language.JAVA);
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b

            if (completionFailureName == c.fullname) {
                throw new CompletionFailure(c, "user-selected completion failure by class name");
Solution content
        //      System.err.println("completing " + c);//DEBUG

        try {
            context.enterJava();

            if (completionFailureName == c.fullname) {
                throw new CompletionFailure(c, "user-selected completion failure by class name");
File
JavaCompiler.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
            implicitSourceFilesRead = true;

        } finally {
<<<<<<< HEAD
            context.leaveJava();
=======
            Context.SourceLanguage.pop();
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b
        }
    }
Solution content
            implicitSourceFilesRead = true;

        } finally {
            context.leaveJava();
        }
    }
File
JavaCompiler.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
    }

            throw new IllegalStateException();
    }

<<<<<<< HEAD
    /**
     * TODO: Ideally this stack should not be static, but Context.isCeylon
     * is required in one or two places where a context is unavailable.
     */
    private static ArrayList ceylonContextStack =
        new ArrayList();

    public void enterCeylon(CompilationUnit cu) {
        ceylonContextStack.add(cu);
    }

    public void leaveCeylon() {
        int size = ceylonContextStack.size();
        assert size > 0;
        CompilationUnit cu = ceylonContextStack.remove(size - 1);
        assert cu != null;
    }

    public void enterJava() {
        ceylonContextStack.add(null);
    }

    public void leaveJava() {
        int size = ceylonContextStack.size();
        assert size > 0;
        CompilationUnit cu = ceylonContextStack.remove(size - 1);
        assert cu == null;
    }

    public static boolean isCeylon() {
        int size = ceylonContextStack.size();
        return size > 0 && ceylonContextStack.get(size - 1) != null;
    }

    public static CompilationUnit ceylonCompilationUnit() {
        return ceylonContextStack.get(ceylonContextStack.size() - 1);
    }
=======

    public static class SourceLanguage {
        public enum Language {
            JAVA, CEYLON
        }

        static ArrayList stack =
            new ArrayList();

        static {
            push(Language.JAVA);
        }

        public static void push(final Language lang) {
            stack.add(lang);
        }
        public static Language pop() {
            return stack.remove(stack.size() - 1);
        }
        public static Language current() {
            return stack.get(stack.size() - 1);
        }
    }

    public static boolean isCeylon() {
        return SourceLanguage.current() == SourceLanguage.Language.CEYLON;
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b
}
Solution content
            throw new IllegalStateException();
    }

    /**
     * TODO: Ideally this stack should not be static, but Context.isCeylon
     * is required in one or two places where a context is unavailable.
     */
    private static ArrayList ceylonContextStack =
        new ArrayList();

    public void enterCeylon(CompilationUnit cu) {
        ceylonContextStack.add(cu);
    }

    public void leaveCeylon() {
        int size = ceylonContextStack.size();
        assert size > 0;
        CompilationUnit cu = ceylonContextStack.remove(size - 1);
        assert cu != null;
    }

    public void enterJava() {
        ceylonContextStack.add(null);
    }

    public void leaveJava() {
        int size = ceylonContextStack.size();
        assert size > 0;
        CompilationUnit cu = ceylonContextStack.remove(size - 1);
        assert cu == null;
    }

    public static boolean isCeylon() {
        int size = ceylonContextStack.size();
        return size > 0 && ceylonContextStack.get(size - 1) != null;
    }

    public static CompilationUnit ceylonCompilationUnit() {
        return ceylonContextStack.get(ceylonContextStack.size() - 1);
    }
}
File
Context.java
Developer's decision
Version 1
Kind of conflict
Attribute
Class declaration
Comment
Method declaration
Method invocation
Chunk
Conflicting content
        System.out.println(tree);

        try {
<<<<<<< HEAD
            context.enterCeylon(t);
=======
            Context.SourceLanguage.push(Language.CEYLON);
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b

            Iterable result =
                task.enter(List.of(tree));
Solution content
        System.out.println(tree);

        try {
            context.enterCeylon(t);

            Iterable result =
                task.enter(List.of(tree));
File
Gen.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
            System.out.println(diagnostics.getDiagnostics());

        } finally {
<<<<<<< HEAD
            context.leaveCeylon();
=======
            Context.SourceLanguage.pop();
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b
        }
    }
Solution content
            System.out.println(diagnostics.getDiagnostics());

        } finally {
            context.leaveCeylon();
        }
    }
File
Gen.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
            aliases = aliases.append(decl);
        }

<<<<<<< HEAD
        public List importDeclarations = List.nil();
=======
        List importDeclarations = List.nil();
>>>>>>> d4e1b9fa2d95210a47cfb76dd77a907d9704014b

        public void accept(Visitor v) { v.visit(this); }
Solution content
            aliases = aliases.append(decl);
        }

        public List importDeclarations = List.nil();

        public void accept(Visitor v) { v.visit(this); }
File
CeylonTree.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation