Skip to content

enum in struct #358

@boaks

Description

@boaks
enum Feature {
    Temperature,
    Pressure,
    Humidity,
    Illuminance,
    Accelerometer,
    Gyroscope,
    Magnetometer
}

struct Sensor {
	var current : float;
	var min : float;
	var max : float;
	var init : bool;
	var feature : Feature;
}

Results in

typedef struct {
	float current;
	float min;
	float max;
	bool init;
	Feature feature;
} Sensor;

typedef enum {
	Temperature,
	Pressure,
	Humidity,
	Illuminance,
	Accelerometer,
	Gyroscope,
	Magnetometer
} Feature;

and error: "unknown type name 'Feature'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workinggood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions