Skip to content

Unknown variable in preprocessor statement #1060

@MaxFromDoqpal

Description

@MaxFromDoqpal

When trying to compile with IL2CPP enabled in Unity, the compiler throws the following error:

"Assets\SQLiteForUnity\Runtime\SQLite-net\src\SQLite.cs(2615,26): error CS0103: The name 'prop' does not exist in the current context"

After investigating the referenced line it became obvious, that the "prop" variable in line 2615 in the preprocessor statement does not get declared anywhere. Maybe due to some prior refactoring.

sqlite-net/src/SQLite.cs

Lines 2608 to 2621 in 758ad7a

public Column (MemberInfo member, CreateFlags createFlags = CreateFlags.None)
{
_member = member;
var memberType = GetMemberType(member);
var colAttr = member.CustomAttributes.FirstOrDefault (x => x.AttributeType == typeof (ColumnAttribute));
#if ENABLE_IL2CPP
var ca = prop.GetCustomAttribute(typeof(ColumnAttribute)) as ColumnAttribute;
Name = ca == null ? prop.Name : ca.Name;
#else
Name = (colAttr != null && colAttr.ConstructorArguments.Count > 0) ?
colAttr.ConstructorArguments[0].Value?.ToString () :
member.Name;
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions