Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes Issue 9312 - With diagnostic is wrong.

  • Loading branch information...
commit 617c393034024471722ed73711d7100fa3a45780 1 parent 11f6af0
@drey08 drey08 authored
Showing with 14 additions and 1 deletion.
  1. +1 −1  src/statement.c
  2. +13 −0 test/fail_compilation/diag9312.d
View
2  src/statement.c
@@ -4538,7 +4538,7 @@ Statement *WithStatement::semantic(Scope *sc)
sym->parent = sc->scopesym;
}
else
- { error("with expressions must be class objects, not '%s'", exp->type->toChars());
+ { error("with expressions must be aggregate types, not '%s'", exp->type->toChars());
return NULL;
}
}
View
13 test/fail_compilation/diag9312.d
@@ -0,0 +1,13 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/diag9312.d(10): Error: with expressions must be aggregate types, not 'int'
+---
+*/
+
+void main()
+{
+ with (1)
+ {
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.