Questions tagged [name-conflict]

A situation in which two or more identifiers within a given scope cannot be unambiguously resolved.

Programmers are expected to ensure that the identifiers of entities are unique in a given scope and not open to multiple interpretations. When this is not ensured, a name-conflict (or a name-collision) occurs.

Different compilers have different rules for resolving name conflict, which is captured by name-mangling (also known as name decoration).

47 questions
43
votes
1 answer

Does an amazon cloudfront distribution with multiple origins conflict?

i have 2 different images in 2 websites at: http://www.siteA.com/avatar.png http://www.siteB.com/avatar.png If i create an Amazon Cloudfront distribution with 2 origins: www.siteA.com and www.siteB.com and then i call for…
Rakib
  • 12,376
  • 16
  • 77
  • 113
12
votes
4 answers

How to resolve a name collision between a C++ namespace and a global function?

if I define a namespace log somewhere and make it accessible in the global scope, this will clash with double log(double) from the standard cmath header. Actually, most compilers seem to go along with it -- most versions of SunCC, MSVC, GCC -- but…
cj.
  • 250
  • 1
  • 3
  • 13
11
votes
2 answers

How to disambiguate a plpgsql variable name in a ON CONFLICT clause?

Given this table: create table test ( name text primary key ); I need to write a plpgsql function with a variable name that collides with the primary key name, which I must use in a on conflict clause: create or replace function func( name…
Tobia
  • 17,856
  • 6
  • 74
  • 93
9
votes
1 answer

How to manage several python subprojects with setuptools?

I'm wondering about the correct/easiest/most pythonic way of dealing with subprojects that you want have using the same base package. We currently have a file structure like this: trunk\ proj1\setup.py company_name\__init__.py +…
7
votes
3 answers

Name conflict between template struct and template member function

In the following, GCC confuses template struct name with template member function name of class A, while Clang compiles fine (live example): template struct name {}; struct A { template void name() { } }; template
iavr
  • 7,547
  • 1
  • 18
  • 53
7
votes
1 answer

How to tell Haskell to not import the same instance from two modules?

I'm using the following typeclass: module T where class T a where v :: a An instance of T Int that I implemented: import T import A (av) instance T Int where v = 0 main = putStrLn (av ++ show v) And a module that I want to use a value from,…
Dog
  • 7,707
  • 8
  • 40
  • 74
6
votes
1 answer

What do I do when two angular libraries have an attribute name conflict?

I'm writing an angular application using two libraries: ngx-bootstrap and ng-apexcharts. ApexCharts provides an angular component, called that takes an input called tooltip of type ApexTooltip. The html looks like this:
6
votes
1 answer

New MATLAB version overrides my function with class method. Can I still call my function?

I had a function in a file harmonic.m in my matlab path with prototype: function D = harmonic(A,B,C) where, importantly, A is expected to be a matrix of type double. In version r2014a, apparently MATLAB has created a new builtin class method…
Alec Jacobson
  • 6,032
  • 5
  • 51
  • 88
4
votes
0 answers

Calling interface's default method when superclass has private method

Consider the code below. interface I { default Number f() { return 0; } } class A { private Number f() { // if Number is replaced with other type, all will work fine return 1; } } class B extends A implements I…
4
votes
1 answer

how do I handle conflicting function names between my antlr grammar and target language

I have a grammar that contains function names called eval and round, these are already functions in python and when I try to generate the listener using: antlr4 -listener -lib /src/grammar -Dlanguage=Python3 -o /gen -no-visitor…
whisperstream
  • 1,897
  • 3
  • 20
  • 25
3
votes
1 answer

Resolving conflicts in methods calling functions with the same name in C++

Consider the following stripped-down example of a (templated) C++ structure for square matrices (it doesn't need to be templated for the problem to occur): #include #include using namespace std; double conj (double &x) { return x;…
FreeQuark
  • 213
  • 1
  • 8
2
votes
3 answers

How to import external package symbols with excluding some

In a new package I want to :use (inherit from) package packa and packb. packa and packb have an intersection of exported symbols. How is it possible to inherit all from packa but only those of packb that are not intersecting with packa? UPDATE: I've…
Manfred
  • 423
  • 3
  • 9
2
votes
2 answers

How do I resolve name conflict in MATLAB?

I created a GUI called "stack" in MATLAB. It has a .m file associated with it. This GUI is called on multiple occasions by another GUI in the same folder. Now I discovered that "stack" is a built-in function in MATLAB which I need to use for…
loudmummer
  • 544
  • 3
  • 19
2
votes
2 answers

C# namespaces: how to follow standards without causing annoying conflicts?

I'm working on a C# library (let's just call it "Foo" for the sake of this question). It has some needs very similar to standard .NET needs: for example, it provides some drawing services, and some conversion services. For the sake of familiarity…
Joe Strout
  • 2,634
  • 2
  • 28
  • 39
2
votes
2 answers

Should creating a variable named _this conflict with this?

This is a very contrived example, but let's suppose we create a variable _this somewhere in a class function. class Person { constructor (public name : string) {} changeName(name) { var _this = {}; (() => { this.name = name; …
Peter Olson
  • 139,199
  • 49
  • 202
  • 242
1
2 3 4