草庐IT

Ambiguous

全部标签

linux - 从 Git 中删除敏感数据。 "fatal: ambiguous argument ' rm'"

我正在尝试运行此命令:gitfilter-branch--force--index-filter'gitrm--cached--ignore-unmatchfilename.js'--prune-empty--tag-name-filtercat----all但我一直收到这个错误:fatal:ambiguousargument'rm':unknownrevisionorpathnotintheworkingtree.Use'--'toseparatepathsfromrevisions,likethis:'git[...]--[...]' 最佳答案

android - Gradle 失败并显示 "Ambiguous method overloading for method java.io.File#<init>"

当gradlebuild我的项目时,我收到了这个错误:FAILURE:Buildfailedwithanexception.Where:Buildfile'App/build.gradle'line:45Whatwentwrong:Aproblemoccurredevaluatingproject':App'.Ambiguousmethodoverloadingformethodjava.io.File#.Cannotresolvewhichmethodtoinvokefor[null,classjava.lang.String]duetooverlappingprototypesbe

android - 无法在 Intent : The Method Put Extra is Ambiguous for the type Intent 中传递自定义对象

如果我尝试写作CarmyCarObject=getCar();Intentdetails=newIntent(Start.this,DetailsCar.class);details.putExtra("Car",myCarObject);startActivity(details);Eclipse向我显示编译错误“TheMethodPutExtraisAmbiguousforthetypeIntent”行中details.putExtra("Car",myCarObject);如果我使用代码CarmyCarObject=getCar();ArrayListparcelableExtr

c++ - "Ambiguous base class"模板上下文错误

我有这个函数模板:templateclassTemplateType>TemplateArgumentf(constTemplateType&arg){returnTemplateArgument();}这样使用,编译失败:structA{};templatestructS{};templatestructB:publicS{};structC:publicB{};intmain(){f(C());return0;}错误信息是::Infunction'intmain()'::15:10:error:nomatchingfunctionforcallto'f(C)'f(C());^:2:

c++ - "ambiguous overload for ' operator[] '"如果存在到 int 的转换运算符

我正在尝试为一个类实现类似vector和类似map的[]运算符。但我从我的编译器(g++和clang++)收到错误消息。发现它们只有在类也有转换为整数类型的运算符时才会发生。现在我有两个问题。首先是我不知道为什么编译器在类有的时候不能区分[](conststd::string&)和将运算符转换为整数。第二个......我需要转换和索引运算符。如何解决?作品:#include#includestructFoo{Foo&operator[](conststd::string&foo){}Foo&operator[](size_tindex){}};intmain(){Foof;f["foo

c++ - 如何修复 "ambiguous"函数调用?

我正在编写一个用于类的C++程序,而我的编译器正在提示一个“模棱两可”的函数调用。我怀疑这是因为有几个函数定义了不同的参数。如何告诉编译器我想要哪一个?除了针对特定情况的修复之外,是否有一般规则(例如类型转换)可以解决这类问题?编辑:就我而言,我尝试调用abs()内部cout声明,传入两个double秒。cout编辑2:我包括这三个标题:#include#include#includeusingnamespacestd;编辑3:我已经完成了没有这段代码的程序,但是为了解决这个问题,我已经重现了这个问题。逐字错误是:Callto'abs'isambiguous.编译器提供了三个版本的ab

scala - 为什么 Play 项目中 sbt-docker 的 enablePlugins(DockerPlugin) 会给出 "error: reference to DockerPlugin is ambiguous"?

我正在尝试dockerize一个playweb应用程序,我正在使用sbt-docker。当我执行sbtdocker时,我得到了一个令人毛骨悚然的错误:error:referencetoDockerPluginisambiguous;itisimportedtwiceinthesamescopebyimport_root_.sbtdocker.DockerPluginandimport_root_.com.typesafe.sbt.packager.docker.DockerPluginenablePlugins(DockerPlugin)^[error]Typeerrorinexpre

java - 为什么 `System.out.println(null);` 给出 "The method println(char[]) is ambiguous for the type PrintStream error"?

我正在使用代码:System.out.println(null);显示错误:Themethodprintln(char[])isambiguousforthetypePrintStream为什么null不代表Object? 最佳答案 PrintStream中有3个println方法接受引用类型-println(charx[]),println(字符串x),println(Objectx).当你传递null时,所有3都适用。方法重载规则更喜欢具有最具体参数类型的方法,因此不选择println(Objectx)。那么编译器无法在前两者之

java - 编译器错误 : reference to call ambiguous

案例1staticvoidcall(Integeri){System.out.println("hi"+i);}staticvoidcall(inti){System.out.println("hello"+i);}publicstaticvoidmain(String...args){call(10);}案例1的输出:hello10案例2staticvoidcall(Integer...i){System.out.println("hi"+i);}staticvoidcall(int...i){System.out.println("hello"+i);}publicstaticvo

dart - 错误 : The name 'Image' is defined in the libraries 'package:flutter/src/widgets/image.dart' and 'package:image/src/image.dart' . -- ambiguous_import

如何解决Dart中的这种歧义错误。import'dart:io';import'package:flutter/material.dart';import'package:camera/camera.dart';import'package:image/image.dart';returnMaterialApp(title:'Camera',home:Scaffold(body:newContainer(child:_image==null?Text('NoImagetodisplay'):Image.file(_image),),floatingActionButton:newFlo