ambiguous

Eliminating grammar ambiguity when a rule covers a subset of another

北城余情 提交于 2021-01-28 02:08:27
问题 I am trying to build a small bison grammar, but am having an issue with part of the definition. Functions can be called with any expression legal on the right side (expression_list in the grammar) as arguments. The issue arises because on the left side, functions can be defined by assigning to them (an identifier followed by a list of identifiers - assignment_expression and identifier_list in the grammar) My question is how I can eliminate the ambiguity in my grammar, since the statements

typedef and template parameter with same name

安稳与你 提交于 2021-01-26 22:29:36
问题 Why is that case incorrect (it's logical) template <typename T> struct Der: public Base { typedef int T; T val; }; , but that case is correct? struct Base { typedef int T; }; template <typename T> struct Der: public Base { T val; }; The Standard 14.6.1/7 says: In the definition of a class template or in the definition of a member of such a template that appears outside of the template definition, for each base class which does not depend on a template-parameter (14.6.2), if the name of the

Ambiguous method call with Integer

橙三吉。 提交于 2021-01-05 06:37:40
问题 I am writing some Junit tests in Android, and if i do this: public void testSetId(){ Friend friend = new Friend(5); assertEquals(5,friend.getId()); } I get an ambiguous method call error. Ambiguous Method Call: Both AssertEquals(int, int) and AssertEquals(Object, Object) match Yet If i do this: public void testSetId(){ Integer ID = 5; Friend friend = new Friend(ID); assertEquals(ID, friend.getId()); } It works. I feel like the second function should be doing the exact same thing. What is

Ambiguous call when using LINQ extension method on DbSet<T>

北战南征 提交于 2020-12-30 05:13:29
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

被刻印的时光 ゝ 提交于 2020-12-30 05:13:27
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

心不动则不痛 提交于 2020-12-30 05:12:28
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

寵の児 提交于 2020-12-30 05:11:30
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Ambiguous call when using LINQ extension method on DbSet<T>

a 夏天 提交于 2020-12-30 05:09:54
问题 I am using a LINQ query on a DbSet<T> : await _dbContext.Users.AnyAsync(u => u.Name == name); However, the compiler outputs the following error: Error CS0121: The call is ambiguous between the following methods or properties: 'System.Linq.AsyncEnumerable.AnyAsync<TSource>(System.Collections.Generic.IAsyncEnumerable<TSource>, System.Func<TSource, bool>)' and 'Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AnyAsync<TSource>(System.Linq.IQueryable<TSource>, System.Linq

Why is this implicit ambiguity behaviour happening?

旧城冷巷雨未停 提交于 2020-01-30 05:46:09
问题 I have a typeclass Search , which has an instance Search[A] if we have a TypeClass1[A] or a TypeClass2[A] instance. With preference given to the 1 instance. The following compiles: trait TypeClass1[A] trait TypeClass2[A] trait Search[A] object Search extends LPSearch { implicit def case1[A](implicit ev: TypeClass1[A]): Search[A] = null } trait LPSearch { implicit def case2[A](implicit ev: TypeClass2[A]): Search[A] = null } object Test { implicit val ev1: TypeClass1[Int] = null implicit val

Why is this implicit ambiguity behaviour happening?

落花浮王杯 提交于 2020-01-30 05:46:05
问题 I have a typeclass Search , which has an instance Search[A] if we have a TypeClass1[A] or a TypeClass2[A] instance. With preference given to the 1 instance. The following compiles: trait TypeClass1[A] trait TypeClass2[A] trait Search[A] object Search extends LPSearch { implicit def case1[A](implicit ev: TypeClass1[A]): Search[A] = null } trait LPSearch { implicit def case2[A](implicit ev: TypeClass2[A]): Search[A] = null } object Test { implicit val ev1: TypeClass1[Int] = null implicit val