Commit 273b68c1 authored by Robin Freyler's avatar Robin Freyler

[lang2/macro] add failure UI test for #[ink(event)] provided with another #[ink(storage)]

parent c59d41f7
......@@ -41,4 +41,5 @@ fn compile_tests() {
t.compile_fail("tests/ui/fail/15-multiple-storage-structs.rs");
t.compile_fail("tests/ui/fail/16-storage-impl-ident-conflict.rs");
t.compile_fail("tests/ui/fail/17-conflicting-ink-markers.rs");
t.compile_fail("tests/ui/fail/18-conflicting-ink-markers-2.rs");
}
#![feature(proc_macro_hygiene)]
use ink_lang2 as ink;
#[ink::contract(version = "0.1.0")]
mod noop {
#[ink(storage)]
struct Noop {}
#[ink(event)]
#[ink(storage)] // We cannot have #[ink(event)] if we already have #[ink(storage)]
struct Event {}
impl Noop {
#[ink(constructor)]
fn new(&mut self) {}
#[ink(message)]
fn noop(&self) {}
}
}
fn main() {}
error: invalid ink! attribute found for `#[ink(event)]` struct
--> $DIR/18-conflicting-ink-markers-2.rs:11:10
|
11 | #[ink(storage)] // We cannot have #[ink(event)] if we already have #[ink(storage)]
| ^^^^^^^^^
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment