diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrTypeDefinitionMembersCache.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrTypeDefinitionMembersCache.java index a57aeb988aa4..1f4ac2f191e0 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrTypeDefinitionMembersCache.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/GrTypeDefinitionMembersCache.java @@ -354,12 +354,7 @@ public class GrTypeDefinitionMembersCache { @Override public boolean process(VirtualFile file, Collection values) { for (TraitFieldDescriptor descriptor : values) { - final GrLightField field = new GrLightField( - trait, - descriptor.name, - myElementFactory.createTypeFromText(descriptor.name, trait), - trait - ); + final GrLightField field = new GrLightField(trait, descriptor.name, descriptor.typeString); if (descriptor.isStatic) { field.getModifierList().addModifier(STATIC_MASK); } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveToCompiledTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveToCompiledTest.groovy new file mode 100644 index 000000000000..b33aba13cb0f --- /dev/null +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/resolve/ResolveToCompiledTest.groovy @@ -0,0 +1,45 @@ +/* + * Copyright 2000-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jetbrains.plugins.groovy.lang.resolve + +import com.intellij.openapi.module.Module +import com.intellij.openapi.roots.ContentEntry +import com.intellij.openapi.roots.ModifiableRootModel +import com.intellij.testFramework.LightProjectDescriptor +import com.intellij.testFramework.PsiTestUtil +import groovy.transform.CompileStatic +import org.jetbrains.annotations.NotNull +import org.jetbrains.plugins.groovy.GroovyLightProjectDescriptor +import org.jetbrains.plugins.groovy.util.TestUtils + +import static org.jetbrains.plugins.groovy.config.GroovyFacetUtil.getBundledGroovyJar + +@CompileStatic +class ResolveToCompiledTest extends GroovyResolveTestCase { + + final String basePath = "resolve/" + + final LightProjectDescriptor projectDescriptor = new GroovyLightProjectDescriptor(getBundledGroovyJar() as String) { + @Override + void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @NotNull ContentEntry contentEntry) { + super.configureModule(module, model, contentEntry) + PsiTestUtil.addLibrary(module, model, "some-library", "${TestUtils.absoluteTestDataPath}/lib", 'some-library.jar'); + } + } + + void 'test resolve implemented trait method()'() { + } +} diff --git a/plugins/groovy/testdata/lib/some-library.jar b/plugins/groovy/testdata/lib/some-library.jar new file mode 100644 index 000000000000..4cfdef710e5a Binary files /dev/null and b/plugins/groovy/testdata/lib/some-library.jar differ