Skip to content

Commit 14aa3af

Browse files
committed
avoid method overload with super type
1 parent 23c764a commit 14aa3af

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,18 @@ public TypeScriptWriter addImportUnchecked(String name, String as, String from)
184184

185185
/**
186186
* Imports a type using an alias from a module only if necessary.
187+
* Adds the dependency.
187188
*
188189
* @param name Type to import.
189190
* @param as Alias to refer to the type as.
190191
* @param from PackageContainer to import the type from.
191192
* @return Returns the writer.
192193
*/
193-
public TypeScriptWriter addImport(String name, String as, Dependency from) {
194-
addDependency(from);
195-
return this.addImport(name, as, from.getPackageName());
196-
}
197-
198-
/**
199-
* @deprecated use {@link #addImport(String name, String as, Dependency from)}.
200-
*/
201194
@Deprecated
202195
public TypeScriptWriter addImport(String name, String as, PackageContainer from) {
196+
if (from instanceof Dependency) {
197+
addDependency((Dependency) from);
198+
}
203199
return this.addImport(name, as, from.getPackageName());
204200
}
205201

0 commit comments

Comments
 (0)