summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/call-instance-from-static.slang
blob: 3cb8af5026cd23e683e0148a7b4d36b9ff4ac3fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// call-instance-from-static.slang

// Test that calling an instance method from a static method is an error.

//DIAGNOSTIC_TEST:SIMPLE:-target hlsl -entry main -stage compute

struct Test
{
	void instanceMethod()
	{}

	static void staticMethod()
	{
		instanceMethod();
	}
}

void main()
{
	Test.staticMethod();
}