package com.redhat.ceylon.compiler.typechecker.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class NamedArgumentList extends Element implements Scope {
	
    private ParameterList parameterList;
    private List<String> argumentNames = new ArrayList<String>();
    
    public ParameterList getParameterList() {
        return parameterList;
    }
    public void setParameterList(ParameterList parameterList) {
        this.parameterList = parameterList;
    }
    
    @Override
    public Map<String, DeclarationWithProximity> getMatchingDeclarations(Unit unit, String startingWith, int proximity) {
        Map<String, DeclarationWithProximity> result = super.getMatchingDeclarations(unit, startingWith, proximity+1);
        for (Parameter p: getParameterList().getParameters()) {
            if (p.getName().startsWith(startingWith) && !getArgumentNames().contains(p.getName())) {
                result.put(p.getName(), new DeclarationWithProximity(p, proximity));
            }
        }
        return result;
    }
    
    public List<String> getArgumentNames() {
        return argumentNames;
    }
    
}

@@ -758,16 +758,60 @@
 ity+1);%0A
+        if (getParameterList()!=null) %7B%0A    
         
@@ -874,24 +874,28 @@
             
+    
 if (p.getNam
@@ -987,16 +987,20 @@
         
+    
 result.p
@@ -1060,16 +1060,34 @@
 mity));%0A
+                %7D%0A
         

fix npe